Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Select Distinct with LOB fields

Re: Select Distinct with LOB fields

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Fri, 7 Sep 2007 13:37:10 +0200
Message-ID: <46e137ff$0$244$e4fe514c@news.xs4all.nl>

"Jeremy" <jeremy0505_at_gmail.com> schreef in bericht news:MPG.214b41da4e682a7398a49e_at_news.individual.net...
> In article <46e01453$0$233$e4fe514c_at_news.xs4all.nl>, Shakespeare says...
>> > select foo.pk, foo.data
>> > from foo
>> > where exists ( select null from bar where foo.pk = bar.fk );
>> >
>>
>> I would not use select null here... It works, but I have seen some
>> discussions about null before in this group ;-)
>>
>>
>
> Can you elaborate on that? Surely it doesn't matter what is selected -
> it's a case of if the subquery returns 0 rows or not?
>
> --
> jeremy

Jeremy,

you're right! But in programs I usually see select '1' from table (and one dba consistently used select '8', don't know why, doesn't matter..) . Select null from table works (at the moment) but there has been a discussion about null and compatibility of the Oracle null with other DB's and languages in this group.
If you have quality assurance in your project, the QA will start asking things like 'Are you sure this will keep working?': null is a QA-trigger.... If you use '1' no one will ask any questions.

Again: I know ths works (even in 11g!) but I would avoid any discussion (like this one) and use select '1' ....

Not a big issue however... but the discussion got really out of control...

See
http://groups.google.nl/group/comp.databases.oracle.server/browse_thread/thread/9fe9df601a89bfa

Shakespeare Received on Fri Sep 07 2007 - 06:37:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US