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 |
|
Jakdb
Starting Member
11 Posts |
Posted - 2011-09-21 : 09:06:02
|
| Hi,I am trying to run the below query and i am failing to retrive the order numbers with status messages below,SELECT o.orderNumber FROM [dbo].[Order] o WHERE (SELECT ose.Date AS dateofstatus FROM [Order]oJOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.IDWHERE ose.StatusTo IN ('Audited','Waiting')) >= (SELECT ose.Date AS dateofstatus FROM [Order]oJOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.IDWHERE ose.StatusTo IN ('Audited','Waiting'))when i run the query it's failing due to more than one row retrived.Please help. |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2011-09-21 : 09:35:23
|
| Hello,If you could, please post some sample data and a desired result set and someone will be able to help you more quickly.TIA/ |
 |
|
|
Jakdb
Starting Member
11 Posts |
|
|
rajarajan
Starting Member
48 Posts |
Posted - 2011-09-21 : 10:44:21
|
| CAN U GIVE SOME SAMPLE . |
 |
|
|
Jakdb
Starting Member
11 Posts |
Posted - 2011-09-21 : 11:25:04
|
| Hi raj,Please look into the above pasted link, example was higlited with explanation. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2011-09-21 : 12:40:52
|
| The error message means that one or both of the subqueries in your WHERE clause are returning more than one row.Your query doen't make any logical sense, so you should follow the suggestions of the other posters, and provide the table definitions, sample data, and expected output.CODO ERGO SUM |
 |
|
|
Jakdb
Starting Member
11 Posts |
Posted - 2011-09-21 : 14:15:49
|
| Hi Michael,Could you please verify the link pasted above, it has the explanation with ddl of the table, and sameple order data, |
 |
|
|
|
|
|
|
|