Sample Header Ad - 728x90

How do I select data with a case statement and group by?

10 votes
2 answers
141688 views
I'm trying to manipulate data a little by using a case statement but can't seem to figure it out. Stops -------------------- 1Stop 1-Stop 1 stop 1 Stop 1stop 1 Stop 2-Stop Im trying to come up with: 1-Stop.... 6 2-Stop.... 1 What I've tried is: select CASE when Stops = '1Stop' OR Stops = '1 Stop' OR Stops = '1 stop' then '1-Stop' ELSE Stops END, count(*) from table group by Stops
Asked by KingKongFrog (373 rep)
Sep 19, 2014, 09:28 PM
Last activity: Feb 3, 2023, 12:44 PM