Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Joining against 0 rows
david_barts_at_my-deja.com wrote:
>
> Suppose I do a join like:
>
> SELECT table1.some_column, table2.other_column
> FROM table1, table2
> WHERE table1.p_key = table2.f_key
> AND <other conditions which determine table1.p_key>
>
> However, it is legitimate if table2 doesn't have
> corresponding rows; in this case I want to
> return, say, '' in place of table2.other_column.
>
> Is it possible to do it elegantly (without subqueries?)
>
> Thanks very much!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Check out outer joins.
SELECT table1.some_column, table2.other_column
FROM table1, table2
WHERE table1.p_key = table2.f_key(+)
etc
--
"Some days you're the pigeon, and some days you're the statue." Received on Tue Feb 01 2000 - 05:35:56 CST
![]() |
![]() |