[thelist] SQL Help needed

Andrew Forsberg andrew at thepander.co.nz
Thu Jan 31 20:03:00 CST 2002


>I forgot to ask what brand of SQL you're using.
>
>E.g.: the CASE statement won't work, AFAIK, in MySQL. Although there
>are a few functions you could try if this is sort of approach is
>necessary. UNION will only work in MySQL 4.0.0 or later.

Responding to my own messages yet again:

The CASE ... WHEN .... THEN ... ELSE ... END control flow function
does in fact work with MySQL. Support was added in version 3.23.3 of
the server:
http://www.mysql.com/doc/N/e/News-3.23.3.html

Although the reserved words were enforced in 3.23.2:
http://www.mysql.com/doc/N/e/News-3.23.2.html

The documentation is at the bottom of the control flow doc page:
http://www.mysql.com/doc/C/o/Control_flow_functions.html

Apologies

<tip type="searching mysql.com's docs">
When trying to find something in mysql.com's searchable documentation
you need to use long words, and uncommon words. This makes searching
for, for example the documentation of the CASE structure very
difficult. The problem is because MySQL.com uses it's own FULLTEXT
index of the docs for searching, which disregards words under 4
letters, and has a routine to ignore words which appear to often.

Case, when, then, else, end are doomed as search terms, even in combination.
</tip>

--
Andrew Forsberg
---
uberNET - http://uber.net.nz/
the pander - http://thepander.co.nz/



More information about the thelist mailing list