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://www.postgresql.org/docs/current/sql-createview.html "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