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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 queries help

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 confused

use HP
SELECT a.CustomerID, a.OrderID
FROM 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 correct
Did you get any error?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

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.OrderID
FROM Orders a
INNER JOIN [Overdue Accounts] b
ON a.CustomerID = b.CustomerID
AND b.PaidInFull = 1
Go to Top of Page
   

- Advertisement -