Re: [SQL] death of array?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [SQL] death of array?
Дата
Msg-id CAKFQuwZeaKm7xo-bFDSzMbB2=yxHvxeFXAc2vSSmYoVCeuHyZQ@mail.gmail.com
обсуждение исходный текст
Ответ на [SQL] death of array?  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: [SQL] death of array?
Список pgsql-sql
On Thu, Apr 6, 2017 at 7:32 PM, Rob Sargent <robjsargent@gmail.com> wrote:

I need to gather all segments whose probandset is within in a specified people.
select s.* from segment s
  join probandset ps on s.probandset_id = ps.id
--PROBLEM: WOULD LIKE SOMETHING BETTER THAN THE FOLLOWING:

​SELECT s.* implies semi-joins - so lets see how that would work.

SELECT vals.* 
FROM ( VALUES (2),(4) ) vals (v)
WHERE EXISTS (
    SELECT 1 FROM ( VALUES (ARRAY[1,2,3]::integer[]) ) eyes (i)
        WHERE v = ANY(i)
);
// 2

​HTH

David J.

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: [SQL] death of array?
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [SQL] death of array?