Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwQL7-001Yrt-7L for pgsql-admin@arkaria.postgresql.org; Mon, 15 Apr 2024 17:41:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rwQL5-00EUez-TV for pgsql-admin@arkaria.postgresql.org; Mon, 15 Apr 2024 17:41:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwQL5-00EUeq-GO for pgsql-admin@lists.postgresql.org; Mon, 15 Apr 2024 17:41:55 +0000 Received: from mout.web.de ([212.227.15.14]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwQL2-0030Ci-58 for pgsql-admin@lists.postgresql.org; Mon, 15 Apr 2024 17:41:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1713202907; x=1713807707; i=thewand@web.de; bh=HcecKdkUhahP0h7WRMbKwBWUprnXoKqhtPi76aychvE=; h=X-UI-Sender-Class:Message-ID:Subject:From:To:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:MIME-Version:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=NJfSs8botTfQtHlwzTHH3Fz9/5lwNsLWtwzeXv8w7HVeoqNjSoumDxBU5B3FD4MQ 0MgACmyE4Has46LtcqEGxcb1/VVGTboNu5EWs34Yw+N5MjllShx0d0E1KE/G3JGsT ayaelQEczd342pMcsQzwO0q+sInnMtbenECjY+NGup5qXhLqBrM4WGRMhbkPNxunV TysBDIdAEgGW4Yke/gYtDf1UwzQ89HNVfXPD7jUGKMAubWOoK3GVjEDlecYnzW9MN g8y42to4Al6t0MICyjy1jFrhjCCViASQlD5hjlC5Np1WqywBKaLFQAk06udxzrsvs jfWaag1YsjtvwZel9Q== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.2.135] ([79.215.32.226]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MDMv4-1s4dHZ26o2-001Ppp; Mon, 15 Apr 2024 19:41:47 +0200 Message-ID: Subject: Re: From CROSSTAB: One Column data with Two results columns From: Andreas Wagner To: M Sarwar , "pgsql-admin@lists.postgresql.org" Date: Mon, 15 Apr 2024 19:41:47 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:Q75qSQ4xaCk3g+8vC5JlnTGhCEmlU0aLzKVZN78F63DDslQQrSx PIy550NuyYSAq4uNv0cz64ObxY3KzuA2hs9EyzF/Z2jjhaCCVOPD36AQTuZcckrF5XuTw4T aRrQoi6jIHgfCzeUb2cCC4+dKubn1gcU3YnQckhwDVERUG9oVxMgBRYm31m+qtc1e362R83 XB51kaMkq3N8veyOr5ong== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:86maBpZGWwI=;nJov52HPVW/DPJ5fFYE89J5CDpi plEuMrp/UQ5wOg8UjoVXesqcxhVFxPuteZLtH8BLsOOdI6gHQkUdra1LiEkGhwGEPqTkpyXAh 84GvnHE9kcXjiWM2mr53xRG7HVGEEcgvc8MBukcfD/MTbJ9DXdqidBnqjCvixtaXeLDyAbzkZ eGLouOtrnewGNpdytb5vsoiJ83Heoq6pJiIV4GcZ8Cfpa5oDJeVRDx6GNftRR93L8NMCWpMDc RooOHGj9dGh6PFIdkI+OqOKfwWzARXunXkWiJuhB1FwabGopuWUClBF1Q8JITNjIXJuWerp6K OLeI+maU/X17b9qqOii5pgzhXj3/q58Pzz9Dhyiuqkw1HLDWcbqZqsn8vImzFbSg4ajHuVGk+ ZKp9Ff0HoHCZryCv287FqfhMONJ/jd4orDb/jRLCTZJVZGCgt+kXpXWVPM9aS0KCdDb6ec+VH CZCuWBp35zxTMBHHfXM3j/6Q9dx7l0B1T17aJGU4tiFryVJywwfvzPMpVaBVth2qEDbA3jc7F iGznJuBRc61QJhXlNrupeiyEWBJ3sr7nei1MYaUAHa5S5alhI/+9dBCQOjprPLN61AYoEHre5 fOBFQc/Zyz6YMuyql7sI50P21ypKV35CCZsbEgoX2JfvNz4K2WqofWlbh22FANrPIVRbZWIX3 WJHn/mDEbZsxPztnZrTSeyyeAgIfW1jRTwL+ZQ7BTDPuek4FM79KznVJOo4YYjRQdVn5sNrPz PDbcHvtn+57W15hrHlJxNCUIE9i369XLrbHZ0MYlDypFx2E9qRkiL+xrPSDlNGCEsj/E6UaRy t432xb2dTLOPt8Bcke82kN+p7VdlwZUnxvYn42lg0i3iM= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Mr. Sarwar! I'm not certain about first and last names in foreign countries, so my apologies if it's your first name. Am Montag, dem 15.04.2024 um 12:25 +0000 schrieb M Sarwar: >=20 > Hello Andreas, > Using a function, I am generating=C2=A0 CROSSTAB SQL and the number of > columns will vary for each execution. With that, it is extremely > difficult to use view on this task. I'm still not sure whether I understand your question. You look for a way to produce statements like SELECT test1p1.data, test1p2.data, test1p3.data, f(test1p1.data), f(test1p2.data), f(test1p3.data) FROM test1p1, test1p2, test1p3; programmatically? ("f()" is a user-defined function deriving the left values on the sample-picture to the right values.) In case using multiple tables is new to you, have a look at the "JOIN"- statement. Regards, Andreas Wagner