Matching several rows

From: Ivan Steganov <istegan6(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Matching several rows
Date: 2006-01-18 04:43:18
Message-ID: 3578f52e0601172043s64561353i689350a1c5d4debb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

This is possibly absolutely trivial but I am lost...

A table URIGHTS which stores an ID and the RIGHTs this ID has. One ID may
have many rights and accordingly records in table, sample:

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.

What would be the simplest query?

Thanks!

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2006-01-18 05:04:16 Re: Matching several rows
Previous Message Ken Winter 2006-01-18 03:29:05 Still struggling with history tables