leke
leke

Reputation: 155

GET min over multiple columns

Can someone give me some advice on how I can get the min of values over multiple colums? I'd like to do this without using a subquery if possible.

Thanks in advance!

something like the function 'least'.

Upvotes: 1

Views: 65

Answers (1)

Mureinik
Mureinik

Reputation: 311143

least seems to be exactly what you need:

SELECT LEAST(MIN(col1), MIN(col2), MIN(col3)) AS minium_of_three_columns
FROM   my_table

Upvotes: 5

Related Questions