Re: How to select rows for which column has empty array ? - Mailing list pgsql-general

From Bosco Rama
Subject Re: How to select rows for which column has empty array ?
Date
Msg-id 5391E870.6000004@boscorama.com
Whole thread Raw
In response to How to select rows for which column has empty array ?  (Arup Rakshit <aruprakshit@rocketmail.com>)
List pgsql-general
On 06/06/14 07:30, Arup Rakshit wrote:
>
> How would I select rows which has empty array for the field "team_ids" ?

The shortest way is to test against an empty array constant:
  select id from reporting_groups where team_ids = '{}';

Or you can test using array_length().  Or you test against an empty
array[], cast appropriately.

HTH,
Bosco.


pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Problem with locales on Linux with 9.3.4
Next
From: sramay
Date:
Subject: Re: bytea Issue - Reg