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 17:37:36 +0200
Message-ID: <46e17059$0$228$e4fe514c@news.xs4all.nl>

"cleveridea" <cleveridea.net_at_gmail.com> schreef in bericht news:1189175793.250566.245890_at_19g2000hsx.googlegroups.com...

> On Sep 7, 6:37 am, "Shakespeare" <what..._at_xs4all.nl> wrote:

>> "Jeremy" <jeremy0..._at_gmail.com> schreef in
>> berichtnews:MPG.214b41da4e682a7398a49e_at_news.individual.net...
>>
>>
>>
>> > In article <46e01453$0$233$e4fe5..._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...
>>
>> Seehttp://groups.google.nl/group/comp.databases.oracle.server/browse_thr...
>>
>> Shakespeare
>
> Thanks Shakespeare.  I'll keep that in that back of my mind, but I
> don't worry too much about writing cross-platform-compatible select
> statements.  And, any QA process that simply evaluates my code by
> "hitting" on keyword triggers like my code is a google search can
> respectfully kiss my behind.
>

Actually, I googled for "exist select null from" and found out that it seems to be common practice.... cross platform compatibility is highly overrated, so I agree.... Some QA people don't do anything else but looking if you programmed following (their) standards...

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

Original text of this message

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