Skip to content
Advertisement

Select statement using Group-by while ignoring column on Postgresql

I have a table name “report” in Postgresql db like:

I want to obtain all the rows from above table for which marks were always NAN (irrespective of observation_time) for particular student and class.

Expected output is:

Could someone please help me with the query? Thanks

Advertisement

Answer

if you want to find all rows with NULL in Marks, use:

..the DISTINCT operator removes duplicates from result

another variant is:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement