[SQL] SQL query to display like this

2007-08-24 Thread RPK
I have a table with records like this: Date EmpIDADCode ADAmount - 01-Jul-07101 GPF150 01-Jul-07102 GPF.ADV100 01-Jul-07103 GPF200 01-jul-07104

Re: [SQL] SQL query to display like this

2007-08-24 Thread Richard Huxton
RPK wrote: select PaySlipDate,EmpID, case ADCode when 'GPF' then ADAmount else 0 end GPF, case ADCode when 'GPF.ADV' then ADAmount else 0 end 'GPF.ADV' from EmpSalaryRecord It is showing like this: Date EmpID GPFGPF.ADV - 01-Jul-07 101