select art.artno, art.name from Art
left outer join store on art.artno =store.artno
where art.Artno not in (select art.artno from store)
The query is supposed to be like this but seems not working(I do not get any result rows beside the column names). Using a MSSQL 2008.
table art table store EXPECTED RESULT
artno name artno qty artno name
1 xbox360 1 1 2 XHW
2 XHW 3 2 5 PS2
3 NETANDO 4 1
5 PS2 6 3
6 PS1
4 X1
How do I write a query to get the Expected out shown in the example?
Just to let you know the tables are 100plus K rows large if helps.
Finally some lights on why the above code does not work would be beneficial. I looked at this this link seems that outer join must work, may be I could not understand this at all.
I tried with full outer join
as well, did not help. Using except
I was able to find just the artno
but did not let me produce the name
column.