"Sue Cram" <[EMAIL PROTECTED]> wrote on 02/08/2005 01:18:48 AM:
> Thanks to the people who helped me with my IF statement question
> last night. Now I need to carry it one step further to a compound
> 'IF' statement. Again, can't find much information in the manuals --
>
> Several people sent
Harald Fuchs wrote:
That's correct, but it can be written shorter and clearer:
CASE Lccation
WHEN 1 THEN 'Downstairs Cat Room'
WHEN 2 THEN 'Kitten Room'
WHEN 3 THEN 'Quarantine'
ELSE 'Unknown' END AS Location
- surely it would be better to have the location ids and location names
in a lookup ta
In article <[EMAIL PROTECTED]>,
Johan Höök <[EMAIL PROTECTED]> writes:
> Hi,
> I guess your "CASE" statement should look something like:
> CASE WHEN Location=1 THEN 'Downstairs Cat Room'
> WHEN Location=2 THEN 'Kitten Room'
> WHEN Location=3 THEN 'Quarantine'
> ELSE 'Unknown' EN
I didn't found an IF ... ELSE ... in MySQL ... and I'm using it for at
least 4 years !... since the old 3.23.xx times !!!
So you will have to do:
SELECT a,b,c,
IF(Location=1, 'Downstairs Cat Room',
IF(Location=2, 'Kitten Room',
Hi,
I guess your "CASE" statement should look something like:
CASE WHEN Location=1 THEN 'Downstairs Cat Room'
WHEN Location=2 THEN 'Kitten Room'
WHEN Location=3 THEN 'Quarantine'
ELSE 'Unknown' END AS Location
/Johan
Sue Cram wrote:
Thanks to the people who helped me with my IF state
I did a lot of homework on IF statements recently.
Below are copies of some of the scripts I'm using now.
This first example draws on a database filled with the
names of the world's continents, oceans, nations and
states, each given an ID in a field named IDArea. Each
page on my site has an echo s
Thanks to the people who helped me with my IF statement question last night.
Now I need to carry it one step further to a compound 'IF' statement. Again,
can't find much information in the manuals --
Several people sent me "IF (Adopted=1, 'Y', 'N') AS Adopted FROM Animal" and it
works great.