0

如何将以下查询迁移到 mssql 服务器中,我在此迁移中遭受了很多痛苦.. 帮助将不胜感激..

select FEES,
DECODE(SUBCOM_TYPE ,'S','SPECIAL COMMISSION','D','DEFAULT COMMISSION') AS SUBCOM_TYPE,
TO_CHAR(FROMDATE,'DD-MON-YYYY') AS FROMDATE, 
TO_CHAR(TODATE,'DD-MON-YYYY') AS TODATE,
TO_CHAR(ADDEDDATE,'DD-MON-YYYY') AS ADDEDDATE,
USER_CODE from COMMISSION 
where INST_ID = 'ABC' AND MASTERCODE='106'
4

1 回答 1

3

你可以使用CASE函数

Select .....
CASE SUBCOM_TYPE
WHEN 'S' THEN 'SPECIAL COMMISION'
WHEN 'D' THEN 'DEFAULT COMMISION'
END
于 2013-10-01T10:14:48.093 回答