So I have the following SQL query:
SELECT CASE
WHEN STATUS = 0 THEN 'Pending'
WHEN STATUS = 1 THEN 'Pending'
WHEN STATUS = 2 THEN 'Confirmed'
WHEN STATUS = 3 THEN 'Pending'
WHEN STATUS = 4 THEN 'Pending'
WHEN STATUS = 5 THEN 'Pending'
WHEN STATUS = 6 THEN 'Paid'
WHEN STATUS = 7 THEN 'Closed'
WHEN STATUS = 8 THEN 'Rejected' END AS Statuses
FROM ORDERS
WHERE opportunityid = 4054
GROUP BY Statuses
Which returns the following results:
Pending
Confirmed
However, I am trying to achieve the following:
Pending,Confirmed
Can this be done without the use of a @declare function too.