Subselect with limit

From: "A B" <gentosaker(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Subselect with limit
Date: 2008-07-25 09:52:56
Message-ID: dbbf25900807250252r22a49c87i4c2c2bde99bad1c5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I guess I can't do like this
SELECT id,a,b FROM T WHERE id NOT IN (SELECT id FROM T2 WHERE
c=5) LIMIT 20;

I only want 20 rows.
How do I do it?

I have table
T (
id ,a,b integer, primary key(id) );
T2 (id

Browse pgsql-general by date

  From Date Subject
Next Message A B 2008-07-25 10:02:23 limit with subselect
Previous Message Richard Huxton 2008-07-25 09:18:26 Re: I often have to do "update if exist, else insert", is my database design wrong?