SQL summary based on condition
Hi All,How can I get the desired summary in SQL query based on some conditions.
Please find my attached screen shot on next thread.
Thanks,
Ram Prasad
LINE-1 NO 25
LINE-1 YES 25
Select LineNo, Sum(Case status When NO then Sum(Manpower)/2 Else Sum(Manpower) END) as Summary FROM Table_Name
Group By LineNo
Select LineNo, Status, Sum(Manpower) as Manpwer
FROM Table_Name
Group By LineNo, Status