Path: news.easynews.com!easynews!crtntx1-snh1.gtei.net!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.maxwell.syr.edu!newsfeed.esat.net!diablo.theplanet.net!news.indigo.ie!not-for-mail
From: paul@not.a.chance.eircom.net (Paulie)
Newsgroups: comp.databases.theory
Subject: Re: Celko: help with an experiment
Message-ID: <3d277d11.78977703@news1.eircom.net>
References: <c0d87ec0.0207031105.996ef17@posting.google.com>
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 71
Date: Sat, 06 Jul 2002 23:36:03 GMT
NNTP-Posting-Host: 159.134.177.31
X-Complaints-To: abuse@eircom.net
X-Trace: news.indigo.ie 1025998663 159.134.177.31 (Sun, 07 Jul 2002 00:37:43 BST)
NNTP-Posting-Date: Sun, 07 Jul 2002 00:37:43 BST
Organization: Eircom.Net http://www.eircom.net
Xref: easynews comp.databases.theory:21655
X-Received-Date: Sat, 06 Jul 2002 16:34:58 MST (news.easynews.com)


71062.1056@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--


