Search Postgresql Archives

Re: xpath_list() function

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

 




Original Message From Andy Dale

Hi,

testdb=# SELECT film_name, xpath_list(description, 'year') FROM filminfo;
film_name     | xpath_list
---------------  +------------
Casablanca      | 1942
Rear Window   | 1954
The Godfather | 1972
Test film          | 1973,1972

It would seem reasonable in this example that the 1973,1972 gained from xpath_list could be reused in a WHERE clause like so

SELECT film_name WHERE '1973' IN (xpath_list(description, 'year'));

How about SELECT film_name WHERE (ARRAY['1973'] <@ STRING_TO_ARRAY((xpath_list(description, 'year')), ',' ); ?

(not tested...)

Regards,
George






[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