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 |
|
lisleche
Starting Member
2 Posts |
Posted - 2003-10-12 : 01:49:46
|
| I am trying to do an embedded select statement in the where clause.. such as this.. select TITLE, COSTFROM moviesWHERE COST =(SELECT max(COST) FROM movies)ORDER BY TITLEBut I need to also do one for a variable of the cost with in $2.00 of the max cost.. How do I go about doing this.. every thing I have tried has failed.. I do not know where I am going wrong; |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-10-12 : 03:54:47
|
Try this:SELECT TITLE, COST FROM movies WHERE ((SELECT MAX(COST) FROM movies) - COST) <= 2Owais Make it idiot proof and someone will make a better idiot |
 |
|
|
lisleche
Starting Member
2 Posts |
Posted - 2003-10-12 : 04:10:58
|
| Yes this works. Thanks.. I was making things really difficult for myself. I guess I just needed to simplify.. |
 |
|
|
|
|
|