List:General Discussion« Previous MessageNext Message »
From:Gordon Bruce Date:November 4 2005 10:06pm
Subject:RE: SQL Statement Conversion
View as plain text  
If your MySQL server is a *nix system than table names are case
sensitive.

SELECT A.*, 
       CASE CounselorOnly 
         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.

-----Original Message-----
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'
END
FROM Activities a ORDER BY Activity

What is the proper syntax for this in MySQL?

Thanks,
Jesse


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1



Thread
SQL Statement ConversionJesse Castleberry4 Nov
RE: SQL Statement ConversionGordon Bruce4 Nov