Re: Query/Subquery help
Date: Tue, 3 Jul 2001 10:28:04 -0500
Message-ID: <9hsobv$ob5$1_at_bob.news.rcn.net>
Try the IN operator
SELECT cname
FROM col
WHERE tname
IN (SELECT tname
FROM where_ever WHERE criteria );
Patrick <patrick_at_holderness.net> wrote in message
news:4e7b730.0107030538.7bb6ed59_at_posting.google.com...
> Is there a simple way to use the results of a subquery as the
> condition of a query?
>
> I have a table with several prefixed columns and would like to obtain
> the values of those prefixed columns only. It seems like I should be
> able to do something like this:
>
> select (select cname from col where tname=<table> and cname like
> <prefix%>) from <table> where...
>
> This returns multiple values and I need a way to iterate thru the
> subquery to avoid the "single row subquery returns more than one row"
> error message.
>
> TIA
Received on Tue Jul 03 2001 - 17:28:04 CEST