Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
how can i mix both querys
select max(case when Parameter = '+' then Description end) as[Allowance] , max(case when Parameter = '-' then Description end)as[Deduction] from (select*,row_number() over (partition by Parameter order by Id) as RN from Cygnus_HR_Salary_Structure_Master_General)X group by RN select sal.EmployeeID,emp.Name as [Name],gm.CodeDesc as[Designation], (CASE WHEN sm.Parameter='+' THEN sm.Description END ) as[Allowance], (CASE WHEN sm.Parameter='+' THEN sm.Amount END ) as[Allowance Amount], (CASE WHEN sm.Parameter='+' THEN sm.Percentage END ) as[Percentage], (CASE WHEN sm.Parameter='-' THEN sm.Description end) as[Deduction], (CASE WHEN sm.Parameter='-' THEN sm.Amount END ) as[Deduction Amount], (CASE WHEN sm.Parameter='-' THEN sm.Percentage END ) as[Percentage], (CASE WHEN sm.IsOther='1' AND sm.Parameter='+' THEN sm.Amount END) as[Others Allowance], (CASE WHEN sm.IsOther='1' AND sm.Parameter='-' THEN sm.Amount END) as[Others Deduction] FROM CYGNUS_HR_Employee_SalaryStructureSlab sal INNER JOIN Cygnus_HR_Employee_Master emp on sal.EmployeeID=emp.EmployeeID INNER JOIN Cygnus_HR_Salary_Structure_Master_General sm on sal.SalaryComponent=sm.SalaryComponent INNER JOIN Cygnus_HR_Master_General gm ON gm.CodeId=emp.Designation GROUP by sm.Parameter,sal.EmployeeID,emp.Name,gm.CodeDesc,sm.Description,sm.Amount,sm.Percentage,sm.IsOther
run
|
edit
|
history
|
help
0
ss
Tbl
Ggg
Shruti
bc160401882
NAMES CODE
student
6
group_concat in sql-server
Alquileres