I have no idea why I am having problems with this query. I got no problems with multiple outer joins mixed with inner joins and aliases table queries, but this has got me stumped. Basically I want to return all the rows from one table that do not exist in another. The tables are quite simple... Both tables have 1 column each. Table A is a table of ids, and Table B is actually a view that consolidates a lot of data and simplifies the presentation.
For example:
Table A
1
2
3
4
5
6
Table B
2
4
5
6
I want my qeury to return {1, 3}.
When I do:
SELECT *
FROM A
WHERE A.id NOT IN (SELECT id FROM B)
The results are all elements of Table A.
The RDBMS I am using is MS SQL Server 7.
Resolution
I'm an idiot and forgot to chomp() the variables that are put into table A by a perl script. None of the fields would match because of the newline character. Sorry for being stupid
For example:
Table A
1
2
3
4
5
6
Table B
2
4
5
6
I want my qeury to return {1, 3}.
When I do:
SELECT *
FROM A
WHERE A.id NOT IN (SELECT id FROM B)
The results are all elements of Table A.
The RDBMS I am using is MS SQL Server 7.
Resolution
I'm an idiot and forgot to chomp() the variables that are put into table A by a perl script. None of the fields would match because of the newline character. Sorry for being stupid