Re: Matching several rows
От
Volkan YAZICI
Тема
Re: Matching several rows
Дата
Msg-id
20060118115517.GA578@alamut
Ответ на
Matching several rows (Ivan Steganov)
Список
Дерево обсуждения
Matching several rows Ivan Steganov <istegan6@gmail.com>
Re: Matching several rows Volkan YAZICI <yazicivo@ttnet.net.tr>
Re: Matching several rows Michael Glaesemann <grzm@myrealbox.com>
Re: Matching several rows Volkan YAZICI <yazicivo@ttnet.net.tr>
Re: Matching several rows Michael Glaesemann <grzm@myrealbox.com>
Re: Matching several rows Patrick JACQUOT <patrick.jacquot@anpe.fr>
Re: Matching several rows Ivan Steganov <istegan6@gmail.com>
Re: Matching several rows Vraj Mohan <vrajmohan@comcast.net>
Re: Matching several rows Michael Glaesemann <grzm@myrealbox.com>
Hi, On Jan 18 05:43, Ivan Steganov wrote: > ID RIGHT > --------------------- > 20 1 > 20 2 > 20 5 > 20 10 > 30 2 > 30 10 > > Now I need to find out which IDs have, say rights 2 AND 5 AND 10. SELECT t.id FROM (SELECT id, sum(1) AS s FROM id_n_rights WHERE rights = ANY(ARRAY[2,5,10]) GROUP BY id) AS t WHERE t.s = 3; -- 3 = length(ARRAY[2,5,10]) HTH. Regards.
В списке pgsql-sql по дате отправления