If your MySQL server is a *nix system than table names are case
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS CO
FROM Activities A
ORDER BY Activity
I also just noticed, remove the "CO =" and add "AS CO" following the END
of the case statement.
From: Jesse Castleberry [mailto:JesseC@stripped]
Sent: Friday, November 04, 2005 3:54 PM
To: MySQL List
Subject: SQL Statement Conversion
I'm converting an application from SQL Server to MySQL. I have the
following query that I need to convert:
SELECT A.*, CO = CASE CounselorOnly WHEN 1 THEN 'Yes' WHEN 0 THEN 'No'
FROM Activities a ORDER BY Activity
What is the proper syntax for this in MySQL?
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql