|
Posted by Ed Murphy on 09/21/06 13:20
James Foreman wrote:
> In DB2, if I have two sets of data and I want to exclude the second set
> from the first, I can do:
>
> SELECT col1, col2, col3, ... colN
> FROM table1
> EXCEPT
> SELECT col1, col2, col3, ... colN
> FROM table2
> ;
Say table1 and table2 both have a primary key of col1, then do:
select table1.col1, table1.col2, table1.col3, ..., table1.colN
from table1
left join table2 on table2.col1 = table1.col1
where table2.col1 is null
Navigation:
[Reply to this message]
|