mojahidm Posted February 26, 2019 Posted February 26, 2019 Hi Team, I'm currently working on trying to get number of services by request types I've got the following code: SELECT h_fk_servicename, SUM (CASE WHEN h_requesttype = 'Incident' THEN 1 ELSE 0 END) AS incident FROM h_itsm_requests WHERE h_datelogged between '19-01-01' AND '19-01-31' GROUP BY h_fk_servicename and when I run it I get the following error: I was wondering if you might be able to shed some light on this. I'm trying to see if I can get a count to work in a CASE statement. Many thanks, Mojahid
HHH Posted February 26, 2019 Posted February 26, 2019 You managed to get a space between SUM and the initial bracket. Changing "SUM (" to "SUM(" should do it
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now