SELECT
PC_COMP_CODE,
'R',
PC_RESUB_REF,
DECODE(PC_SL_LDGR_CODE,'02','DR','CR'),
PC_DEPT_NO DEPT,
'',--PC_DEPT_NO,
PC_SL_LDGR_CODE+'/'+PC_SL_ACNO,
SUM( DECODE(PC_SL_LDGR_CODE,'02',1,-1) *PC_AMOUNT),
PC_CHEQUE_NO CHQNO
FROM GLAS_PDC_CHEQUES
WHERE PC_RESUB_REF IS NOT NULL AND PC_DISCD NOT IN ('d','D','T')
GROUP BY PC_RESUB_REF, PC_COMP_CODE, 'JJ', PC_SL_LDGR_CODE+'/'+PC_SL_ACNO, PC_DEPT_NO, PC_CHEQUE_NO, DECODE(PC_SL_LDGR_CODE,'02','DR','CR')
Above is a Oracle query; how can I use DECODE() function in SQL Server 2005?