It's not "illegal" for a subquery to return more than one row...it depends
on how you're using it. At any rate, to answer to your question, you can use
the TOP keyword to return a specific number or percentage of rows:

select userid from bids where bid= (select TOP 1 bid from proxy where bid >
5)

~Dina



----- Original Message -----
From: "Michael Dinowitz" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 4:35 PM
Subject: single return sub queries


> I've got a sub query that may return 2 or more rows. This is illegal in a
sub
> query so I'd like to limit it to just one. Is there any modifier for the
sub
> query to say 1 row only?
> Using this as an example where the select bid is what I'd like to limit.
> select userid from bids where bid= (select bid from proxy where bid > 5)
>
> Thanks
>
> Michael Dinowitz
> Master of the House of Fusion
> http://www.houseoffusion.com
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                        

Reply via email to