limit with subselect - Mailing list pgsql-general

From A B
Subject limit with subselect
Date
Msg-id dbbf25900807250302u407e49d2t42d29f8dc37a4ff6@mail.gmail.com
Whole thread Raw
Responses Re: limit with subselect
Re: limit with subselect
List pgsql-general
Sorry if this is a double posting, I think the previous message was lost.

I have two tables
T (
id int primary key,
a int,
b int
)

T2 (
id int references T,
c int
);

and I wish to get 20 lines from T  like this

select id,a,b from T where id not in (select id from T2 where c=5) limit 20;

but that does not seem to work. How can I get what I want? What 20
records are selected is not important. I just need 20.

pgsql-general by date:

Previous
From: "A B"
Date:
Subject: Subselect with limit
Next
From: "A. Kretschmer"
Date:
Subject: Re: limit with subselect