Question :
I have written a SQL with CASE statement in SELECT, which is creating different columns. And my query output is comping in multiple rows (Please refer attached picture of output).
But I want my output in single row like this:
Please let me know how can I achieve this is SQL. I am using PostgreSQL.
Thanks
Answer :
SELECT {columns without nulls}, MAX({columns with nulls})
FROM table
GROUP BY {columns without nulls}
Of course you must use separate expression for each separate column.