Michael,

I am not sure what type of information that you are trying to get from your 
query but maybe these examples will help you along.

This one will return one record in your subquery:
select userid from bids where bid = (select top 1 bid from proxy where bid > 
5)

This one will allow multiple records to be returned in your sub query:
select userid from bids where bid in (select bid from proxy where bid > 5)

Or my personal favorite:
select
        userid
from
        bids b,
        proxy p
where
        b.bid = p.bid
        and p.bid > 5

Feel free to email me off-list if you need some additional help.

Good luck,

Matthew


>From: [EMAIL PROTECTED] (Michael Dinowitz)
>Reply-To: [EMAIL PROTECTED]
>To: SQL <[EMAIL PROTECTED]>
>Subject: single return sub queries
>Date: Wed, 26 Mar 2003 17:35:22 -0500
>
>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
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                        

Reply via email to