Опитайте функцията NULLIF:
SELECT LEAST(
nullif( number1, 0 ),
nullif( number2, 0 ),
nullif( number3, 0 ),
nullif( number4, 0 ))
FROM numbers
Демо --> http://www.sqlfiddle.com/#!12/641fb3 /1
Опитайте функцията NULLIF:
SELECT LEAST(
nullif( number1, 0 ),
nullif( number2, 0 ),
nullif( number3, 0 ),
nullif( number4, 0 ))
FROM numbers
Демо --> http://www.sqlfiddle.com/#!12/641fb3 /1