Skip to content
Advertisement

How to calculate the maximum of two numbers in Oracle SQL select?

This should be simple and shows my SQL ignorance:

I know max is normally used for aggregates. What can I use here?

In the end, I want to use something like

where number_of_items is an integer and can be 0. I want to see total also in this case.

Advertisement

Answer

You could use a CASE statement

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