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 |
|
bluemetal
Starting Member
26 Posts |
Posted - 2005-08-05 : 02:09:32
|
| Hi, can i do something like the following?Select t.Owner_id, t.Name, t.Phone, (Select Vehicle from Vehicles where vehicle_owner = t.owner_id) as Vehicle_DrivenFrom Table t? i get a Not a Group By expression right at the SELECT within the Select (near the start of bracket).. what am i doing wrong?Thanks! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-05 : 02:35:15
|
| It seems correct. Make sure inner Select does not return more than one valueMadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-05 : 04:54:34
|
I reckon MAD has the answer.Try(Select TOP 1 Vehicle from Vehicles where vehicle_owner = t.owner_id) instead?Mind you, if that fixes it, you need to worry about WHICH Vehicle you actually want to show - the MAX? MIN? TOP 1? TOP 1 with ORDER BY? Kristen |
 |
|
|
|
|
|