Skip to content
Advertisement

subquery double where + aggreate functions

I have table and rows

I want to have sum of balance and payed for simple users with approvedAdminId (isSimpleUser = 1 AND approvedAdminId is not NULL) and for not simple users (isSimpleUser = 0)

Expected Result

Advertisement

Answer

Output:

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