Mysql case的用法

来源:互联网 发布:安全的理财软件 知乎 编辑:程序博客网 时间:2024/05/22 11:36

select convert(DateTime,char(16)),CompanyName,(CASE ContestID WHEN 1 THEN 'ContestA' WHEN 2 THEN 'ContestB' ELSE 'ContestC' END) AS ContestID,

ItemID,ItemType,SongTitle,ArtistName,Channel,Price,MSISDN
from contestdownloadreporting

原创粉丝点击