如何将以下查询迁移到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'
答案 0 :(得分:2)
您可以使用CASE
功能
Select .....
CASE SUBCOM_TYPE
WHEN 'S' THEN 'SPECIAL COMMISION'
WHEN 'D' THEN 'DEFAULT COMMISION'
END