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

Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David" <higgsd(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N
Date: 2007-01-13 18:46:15
Message-ID: 25968.1168713975@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"David" <higgsd(at)gmail(dot)com> writes:
> This statement works:
> => SELECT * FROM sal_emp WHERE 10000 = ANY (pay_by_quarter);

> But this does not:
> => SELECT * FROM sal_emp WHERE ANY (pay_by_quarter) = 10000;
> ERROR:  syntax error at or near "ANY" at character ...

This is not a bug, it's the way the syntax works per SQL spec.
ANY must immediately follow the operator it relates to.  See
<quantified comparison predicate> syntax in the spec.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: David HiggsDate: 2007-01-13 19:39:41
Subject: Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N
Previous:From: DavidDate: 2007-01-13 05:49:28
Subject: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N

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