Help with SQL query

I have two tables:

Table 1, Symbols, contains a colum for the stock symbol. Table 2, Weights, also contains a column for the stock symbol.

Somehow, when I was entering values into an excel spreadsheet that I later imported into MSFT SQL server, I accidentally typed in duplicate symbols into the Weights table.

Is there a sql query that I can use that will return symbols in the Symbols table that are missing from Weights table?

I tried this but the sql interpreter doesn't like it:

Code:
select	Symbols.symbol
from 
	Symbols  inner join Weights on 	
	Weights.symbol = Symbols.symbol
where
	 Symbols.symbol is not in Weights.symbol

Thanks.

nitro
 
How about using "left outer join"

select symbols.symbol, weights.weight
from
symbols left outer join weights on
weights.symbol = symbols.symbol
where
weights.weight is null
 
Quote from Bowgett:

How about using "left outer join"

select symbols.symbol, weights.weight
from
symbols left outer join weights on
weights.symbol = symbols.symbol
where
weights.weight is null
I think that did it!!!

Code:
select symbols.symbol, weights.symbol
from 
symbols left outer join weights on 
weights.symbol = symbols.symbol
where
weights.symbol is null

Thanks :cool:
 
Back
Top