On Wednesday 18 October 2006 14:44, Mario Weilguni wrote:
> Am Mittwoch, 18. Oktober 2006 13:52 schrieb Andreas Joseph Krogh:
> > This has been been discussed before, but Oracle behaves differently, and
> > IMHO in a more correct way.
> >
> > The following query returns NULL in PG:
> > SELECT NULL || 'fisk';
> >
> > But in Oracle, it returns 'fisk':
> > SELECT NULL || 'fisk' FROM DUAL;
> >
> > The latter seems more logical...
> I've worked alot with oracle a few years ago and I agree, the feature is
> handy and makes sometimes life easier, but it's simply wrong. I heard a
> while ago that newer oracle versions changed this to sql - standard, is
> this true?

Oracle( still treats '' as NULL.

Why do these discussions always end in academic arguments over whats more 
logical then not? From a *user's* point of view I really would like it to 
treat the NULL operand of || as '', and obviously many other (at least 
Oracle) users tend to agree with me on that.

On Wednesday 18 October 2006 14:42, Csaba Nagy wrote:
> And it would really return null, if aggregates wouldn't ignore the NULL
> values altogether... the null values are skipped before they get into
> the summing. The same happens with count, if you specify a column it
> will only count the ones which are not null:

If aggregates ignore NULL one could argue that so shuld the ||-operator?

Andreas Joseph Krogh <[EMAIL PROTECTED]>
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
OfficeNet AS            | The most difficult thing in the world is to |
Karenslyst Allé 11      | know how to do a thing and to watch         |
PO. Box 529 Skøyen      | somebody else doing it wrong, without       |
0214 Oslo               | comment.                                    |
NORWAY                  |                                             |
Mobile: +47 909  56 963 |                                             |

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?


Reply via email to