I have a query where I do the following:
GROUP BY CustomerID, LongShort
What I need to do is if CustomerID = 1 then I want to make the LongShort return 'L' if the SUM(Quantity) >= 0 ELSE 'S' otherwise return the LongShort as it is. How can I do this because I can't place the SUM in the Group by with a CASE statement? I am trying to avoid doing nested queries etc. if possible.