How to select grouped rows with only NULL values?

前端 未结 4 1117
一生所求
一生所求 2021-01-24 16:15

If I have a table like

task_id | state
--------+------------ 
   1    |  NULL
--------+------------
   1    |  RESOLVED
--------+------------
   2    |  NULL
--         


        
4条回答
  •  清酒与你
    2021-01-24 17:18

    here is my approach :

        Select  * from yourTable where state is null and task_id not in 
        (select task_id from yourTable y where state is not null )
    

提交回复
热议问题