Skip site navigation (1) Skip section navigation (2)

Re: How to use Integer array in where IN clause parameter

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Ranjan Kumar Baisak <rbaisak(at)nyc(dot)yamaha(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: How to use Integer array in where IN clause parameter
Date: 2007-08-16 18:57:30
Message-ID: 1187290651.24679.10.camel@dogma.ljc.laika.com (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, 2007-08-16 at 14:36 -0400, Ranjan Kumar Baisak wrote:
> Hello,
>          Can anybody suggest me how to use Integer array inside a
> function in where IN clause.
> In my function, I have used it like 
> WHERE   d_base.id in (array_to_string (integer_array, ',')) 
> 
> However it does not work. ANy suggestion?

It looks like you want to use:

WHERE d_base.id = ANY(integer_array)

Regards,
	Jeff Davis


In response to

pgsql-general by date

Next:From: Rainer BauerDate: 2007-08-16 19:32:19
Subject: Re: Yet Another COUNT(*)...WHERE...question
Previous:From: D. Dante LorensoDate: 2007-08-16 18:55:12
Subject: Re: SELECT ... FOR UPDATE performance costs? alternatives?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group