Search Postgresql Archives

"like any" in reverse?

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

 



Hi:

 

create table foo (lst text[]);

insert into foo (lst) values (array[‘jack’,’fred’,’jen’,’sue’]);

 

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.

 

 

Can this be done?

 

Thanks in Advance !


[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