I’ve got a table which contains a column named size.
I want with a min function to find the min value of size and a set of integer.
For example :
Size can be : 5, 10, 15
And I want to find the min result in a set like :
MIN(size,1)
Min method does not seem to have several parameters…
I’ve tried something like:
SELECT min(1, size) FROM myTable
SELECT min(SELECT 1,size FROM myTable) FROM myTable
There is error for each of these syntax.
I precise that I can’t do the comparison in my code because the sql is generated and can be something more complex like:
SELECT min(SELECT size FROM table1, SELECT size FROM table2, 10)
FROM table3
Any idea ?
You can use
leastto find the minimum across columns/expressions andminto find the minimum across rows.Or this would probably be more efficient actually