Search Postgresql Archives

Re: "like any" in reverse?

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

 



"Gauthier, Dave" <dave.gauthier@xxxxxxxxx> writes:
> I want to find all records where any element of lst like 'j%'.
> This does not work...
> select * from foo where 'j%' like any(lst);

> Intuitively, you'd think....
> select * from foo where any(lst) like 'j%';
> ... but that's a syntax error.

Yeah, the ANY has to be on the right-hand side of the operator.
What you can do for this is build yourself a "reverse like"
operator, ie flip the left and right arguments within the function.
I'm pretty sure there are worked-out examples in the archives
if that's not enough of a hint for you.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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