Doonie Darkoo:
I have a table where I'm storing Allowances and Deductions. If the Basecode is 1 then it is an allowance and if BaseCode is 2 then it is deduction. I am trying to get the column transformed into 2 columns.
Allowance Deduction Something Something
SELECT (SELECT INN.FullName AS Benefit FROM [AppCNF].[tbl_AllowanceOrBenefitType] INN WHERE INN.BASECODE = 1 and INN.ID = OUTR.ID), FullName AS Deductions
FROM [AppCNF].[tbl_AllowanceOrBenefitType] OUTR
WHERE BASECODE = 2
This is what I have tried so far but it is giving NULL for Allowances.
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots