Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem converting SELECT with embedded SELECTs
margaret_at_synrevoice.com (Margaret Ngai ) wrote:
>
>I am converting a Sybase SELECT query to Oracle. The problem is
that
>the
>original statement contains 'embedded' SELECTs as follows:
>
>SELECT T1.F1, (SELECT T2.F1 WHERE T1.F2 = T2.F2) WHERE T1.F3 =
'xxx'
>
>I need this setup because I need the statement to return T1.F1
even if
> the
>link to T2 does not exist.
>
>How can I achieve the same result in Oracle? Due to some problem
on t
>he
>custom application I am using, I cannot use stored procedures or
UNION
>.
>
>Thanks for any suggestions.
>
>--
>Margaret Ngai
>E-Mail: margaret_at_synrevoice.com
Try an outer join or a PL/SQL funtion, for example:
Select T1.F1,
get_more_data(T1.F1)
From T1
Where ...
where get_more_data has returns the value if available.
-- \\/// (0-0) +----oOO----(_)-----------+ | K. E. Fein | | Database Analyst | | kfein_at_primenet.com | +------------------oOO----+ | | | |__|__| || || ooO OooReceived on Mon Aug 11 1997 - 00:00:00 CDT