Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Hpolanco
Starting Member
7 Posts |
Posted - 2006-11-03 : 18:41:30
|
Hello can anyone help me to correct this quary i am little confuseduse HPSELECT a.CustomerID, a.OrderIDFROM Orders a WHERE a.CustomerID in ( SELECT b.CustomerID FROM [Overdue Accounts] b WHERE b.PaidInFull = 1 )is is correct let me know if not tell me why and where was the problem.Very thanks HP |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-03 : 19:06:53
|
It is correctDid you get any error?MadhivananFailing to plan is Planning to fail |
 |
|
samuelclay
Yak Posting Veteran
71 Posts |
Posted - 2006-11-03 : 19:10:48
|
Does it return the correct results? if so, then it is correct.What are the desired results?The syntax looks ok. You could also do it using a join.SELECT a.CustomerID, a.OrderIDFROM Orders a INNER JOIN [Overdue Accounts] b ON a.CustomerID = b.CustomerID AND b.PaidInFull = 1 |
 |
|
|
|
|