the best way to get some records not in another table - Mailing list pgsql-sql

From jack
Subject the best way to get some records not in another table
Date
Msg-id 002c01c2ed3f$e7fee740$1400a8c0@jac
Whole thread Raw
List pgsql-sql
Hi, all

Try to get some records not in another table. As the following, please
advise which one will be the best way to do. Or is there any other way to do
better?

SELECT DISTINCT a.c1
FROM test_j2 a
WHERE a.c1 NOT IN (SELECT DISTINCT b.c1 FROM test_j1 b);

SELECT a.c1 FROM test_j2 a
EXCEPT
SELECT b.c1 FROM test_j1 b;


Jack



pgsql-sql by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: PLPGSQL with Multibyte Issue
Next
From: Christoph Haller
Date:
Subject: Re: Min values?