Re: [SQL] the best way to get some records not in another table

2003-03-19 Thread jack
Hi, According to the following report, I think using "except" would be the best way to do. Thank you! Jack EXPLAIN SELECT DISTINCT a.c1 FROM test_j2 a WHERE a.c1 NOT IN (SELECT DISTINCT b.c1 FROM test_j1 b); Unique (cost=54544.91..54547.41 rows=50 width=6) -> Sort

Re: [SQL] the best way to get some records not in another table

2003-03-18 Thread Christoph Haller
> > 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 >