Minimum logical function for beastmode

It would be very helpful to have a LEAST()/MOST() function that calculates the minimum/maximum from a user defined set rather than from a column as MIN()/MAX() does. I understand this can be done with a case currently, but that is very cumbersome. 

 

I would like to be able to do the following:

 

LEAST(datediff(curdate(), min(date)), 30)

 

These would alleviate needing to type out a case such as:

 

case when datediff(curdate(), min(date)) < 30

then datediff(curdate(), min(date))

else 30

 

 

Ideally it could be used with more than 2 variables.

end

 

0
0 votes

· Last Updated

This discussion has been closed.