Re: xpath() subquery for empty array

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: xpath() subquery for empty array
Дата
Msg-id 20090712211755.GW5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: xpath() subquery for empty array  (Roy Walter <walt@brookhouse.co.uk>)
Ответы Re: xpath() subquery for empty array
Список pgsql-general
On Sun, Jul 12, 2009 at 09:49:15PM +0100, Roy Walter wrote:
> Where exactly does that fit in terms of my original query, i.e.:
>
>    SELECT x
>    FROM (SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml)
>    AS x FROM docs) AS y WHERE x <> [test for empty array?????????]

Something like the following should do the right thing:

  SELECT x FROM (
    SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml) AS x
    FROM docs) AS y
  WHERE array_upper(x, 1) > 0;

--
  Sam  http://samason.me.uk/

В списке pgsql-general по дате отправления:

Предыдущее
От: "Brent Wood"
Дата:
Сообщение: Re: indexes on float8 vs integer
Следующее
От: Roy Walter
Дата:
Сообщение: Re: xpath() subquery for empty array