Re: death of array?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: death of array?
Date: 2017-04-07 03:02:53
Message-ID: CAKFQuwZeaKm7xo-bFDSzMbB2=yxHvxeFXAc2vSSmYoVCeuHyZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Apr 6, 2017 at 7:32 PM, Rob Sargent <robjsargent(at)gmail(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleas Mantzios 2017-04-07 06:28:43 Re: death of array?
Previous Message Rob Sargent 2017-04-07 02:32:31 death of array?