Re: From CROSSTAB: One Column data with Two results columns

Поиск
Список
Период
Сортировка
От M Sarwar
Тема Re: From CROSSTAB: One Column data with Two results columns
Дата
Msg-id DM4PR19MB5978C5982BF97D6DE105158AD3092@DM4PR19MB5978.namprd19.prod.outlook.com
обсуждение исходный текст
Ответ на Re: From CROSSTAB: One Column data with Two results columns  (Andreas Wagner <thewand@web.de>)
Ответы Re: From CROSSTAB: One Column data with Two results columns  (Andreas Wagner <thewand@web.de>)
Список pgsql-admin
Hello Andreas,
Using a function, I am generating  CROSSTAB SQL and the number of columns will vary for each execution. With that, it is extremely difficult to use view on this task.
Thanks,
Sarwar


From: Andreas Wagner <thewand@web.de>
Sent: Monday, April 15, 2024 5:03 AM
To: M Sarwar <sarwarmd02@outlook.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: From CROSSTAB: One Column data with Two results columns
 
Hello!

Am Sonntag, dem 14.04.2024 um 20:54 +0000 schrieb M Sarwar:
> Hi,
> I am working CROSSTAB functionality to generate the reports in the
> CSV format.
>  
> Now I have stage where I need to generate 2 result sets  for the same
> 1 column data.

Something like "CREATE VIEW"? The documentation has some useful
examples: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Fsql-createview.html&data=05%7C02%7C%7C68ff07469622406ac6be08dc5d2af2f1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638487686248203307%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=1NwPwfkyT9BBtzDrtrkVNOHbTFo5rcayKuaZm51pqq0%3D&reserved=0

"CREATE PROCEDURE" and "CREATE FUNCTION" are rarely covered by
tutorials, so I mention them. They can be used in a similar manner.


For CSV, I'm the wrong person. I'd code it in C/C++.

Regards,
Andreas Wagner

В списке pgsql-admin по дате отправления:

Предыдущее
От: Adrien Nayrat
Дата:
Сообщение: Re: ERROR could not read block xxx in file, read only 0 of 8192 bytes
Следующее
От: Andreas Wagner
Дата:
Сообщение: Re: From CROSSTAB: One Column data with Two results columns