Skip to content
Advertisement

sql nested “sum (case when) or” select query

I have a select query where I am trying to sum a value based on multiple criteria, grouped by dimension. The output will be the sum of the time greater than 30, 90, or 365 days based on the category, grouped by category. I can’t crack the syntax for this, I hope you can help!

The concept looks something like this:

Thanks in advance!

Advertisement

Answer

I suspect the syntax you want is:

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