Search Postgresql Archives

How to select rows for which column has empty array ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a below table :

yelloday_development=# select id,workplace_ids,team_ids  from reporting_groups ;                                                                                                                                                                                     
 id | workplace_ids | team_ids 
----+---------------+----------
  2 | {}            | {}
  3 | {}            | {}
  1 | {}            | {}
  4 | {1}           | {1}
  5 | {2}           | {2,3,4}
(5 rows)

yelloday_development=# select id from reporting_groups where 2 = ANY (team_ids)
yelloday_development-# ;
 id 
----
  5
(1 row)

How would I select rows which has empty array for the field "team_ids" ?
 
Regards,
Arup Rakshit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux