Re: Using Lateral

2018-03-28 Thread Johann Spies
Thanks David and Paul, You have helped me a lot. Regards Johann. On 28 March 2018 at 20:49, David G. Johnston wrote: > On Tuesday, March 27, 2018, Johann Spies wrote: >> >> In the past I could use this in a query: >> >> SELECT >> DISTINCT ut, >> CASE >> WHEN xpa

Re: Using Lateral

2018-03-28 Thread Paul Jungwirth
On 03/28/2018 05:22 AM, Johann Spies wrote: Thanks Paul. I was hesitant to post my full query. It is a long and complicated query. Ha ha, you aren't joking. :-) With something that long I don't think I'd want to split every xpath call into a new join. I guess you could try it and see though

Re: Using Lateral

2018-03-28 Thread Johann Spies
Thanks Paul. I was hesitant to post my full query. It is a long and complicated query. But here it is now: WITH p AS ( SELECT ARRAY [ ARRAY [ 't', 'http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord' ] ] AS ns), uts AS ( SELECT s.ut FROM wos

Re: Using Lateral

2018-03-27 Thread Paul Jungwirth
On 03/27/2018 03:22 AM, Johann Spies wrote: In the past I could use this in a query: SELECT DISTINCT ut, CASE WHEN xpath_exists ('//t:address_spec/t:country/text()', q.address_spec, p.ns) THEN unnest (xpath ('//t: