V
V
Verkan2020-12-16 17:25:33
SQL
Verkan, 2020-12-16 17:25:33

Greatest and null how to make it work?

There is such a request

SELECT GREATEST (MAX(`price_click`),MAX(`price_views_1000`),MAX(`price_day`),MAX(`price_week`),MAX(`price_month`),MAX(`price_all_day`),MAX(`price_all_week`),MAX(`price_all_month`)) as value" FROM ....

If at least one MAX returns Null, then the entire query will return Null
Yes, if you can shorten the query ... I would be grateful

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-12-16
@Verkan

Wrap each in IFNULL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question