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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Celko: help with an experiment

Re: Celko: help with an experiment

From: Paulie <paul_at_not.a.chance.eircom.net>
Date: Sat, 06 Jul 2002 23:36:03 GMT
Message-ID: <3d277d11.78977703@news1.eircom.net>

71062.1056_at_compuserve.com (--CELKO--) wrote:

MySQL - Win2000 Pro

> 1) SELECT * FROM Foobar;
> [X ] 1

> 2) SELECT MAX(i) FROM Foobar;
> [X ] 1

> 3) SELECT * FROM Foobar WHERE 1 = 0;
> [X ] 1

> 4) SELECT MAX(i) FROM Foobar WHERE 1 = 0;
> [X ] NULL

> 5) SELECT CASE WHEN 1 = 1
> THEN 99
> ELSE COUNT(*) END AS x
> FROM Foobar
> WHERE 1 = 0;
 
> [X ] Empty set

with or without ; at the end...see below.

> 6) SELECT CASE WHEN 1 = 0
> THEN 99
> ELSE COUNT(*) END AS x
> FROM Foobar
> WHERE 1 = 0;

> [X ] Warning
> [ X] Fatal error

May be one or the other



You have an error in your SQL syntax near '; ' at line 5

I leave it to you to judge.

Strangely, though, if you have



SELECT CASE WHEN 1 = 0
                THEN 99
                ELSE COUNT(*) END AS x
      FROM Foobar
     WHERE 1 = 0
--------------------------

i.e. without the final ";" - then it's an empty set....

Rgs.

Paul...

> --CELKO--
Received on Sat Jul 06 2002 - 18:36:03 CDT

Original text of this message

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