Skip to content
Advertisement

SQL: Select MAX value from 2 conditions

I have 1 table and 4 columns. I would like to get max value from visit and spending with use condition as max visit first and max spending second.

enter image description here

The result should be shown on the YELLOW highlight on Image above.

For my code below. Please help me in a better way to do this.

Advertisement

Answer

This would be the ANSI/ISO SQL way of writing the query:

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