Skip to content
Advertisement

Error for the query statement with CASE and Count

This is my original query statement….

I think this works fine…until I want to add a case statement where there is an error……

After modification,

After the 1st query statement, the result is shown as above. I would like to change the value of No.of times column to 0 regardless of the airline for the country ‘MAL’. So I tried to add the case statement to the select, but it gives me like group function is not allowed

How do I fix it?

Advertisement

Answer

I would do Conditional Aggregation :

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement