Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 queries help
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

7 Posts

Posted - 11/03/2006 :  18:41:30  Show Profile  Reply with Quote
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

Premature Yak Congratulator

22864 Posts

Posted - 11/03/2006 :  19:06:53  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
It is correct
Did you get any error?


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

Yak Posting Veteran

71 Posts

Posted - 11/03/2006 :  19:10:48  Show Profile  Visit samuelclay's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000