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 |
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-02-25 : 11:15:35
|
| I want to run a subquery, example is below:select id from XYZ where name like '%yalgaar%' or where name like '%yamaha%'The above statement will return multiple rows. I want to run the above query is a subquery for another SQL Select statement.Select * from funny where ( subquery that reurns multiple rows)When I run the above query, I get an error message below:"Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression." |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-02-25 : 12:13:46
|
Something like this?Select *from funnywhere funny.ID IN ( select id from XYZ where name like '%yalgaar%' or where name like '%yamaha%') Kristen |
 |
|
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-02-25 : 13:14:00
|
| Awesome!!! it worked like a charm :-) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-02-25 : 13:56:06
|
| "it worked like a charm"I guess I got lucky!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-27 : 03:26:25
|
With small change  quote: Originally posted by Kristen Something like this?Select *from funnywhere funny.ID IN ( select id from XYZ where name like '%yalgaar%' or where name like '%yamaha%') Kristen
MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|