0

is there some way to determine the max value out of two values in SQL?

I use the mod function:

MOD(cnt, cnt/100)

This yields a division by 0 error when cnt is smaller than 100. I therefore would like something like this:

MOD(cnt, MAX(cnt/100, 1))
0

1 Answer 1

2

You can use greatest

SELECT greatest(a, b, c) FROM your_table;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.