-- Не эффективный способ, но приемлемый на маленьких выборках B SELECT B.new_column, IF(B.new_column < 1000, B.new_column, B.new_column + 1000) AS new_column2 FROM ( SELECT IF(a.id > 500, a.id, a.id + 500) as new_column FROM table a ) AS B; -- А можно и так... SELECT (a.id + IF(a.id < 500, 500, 0)) as new_column, (a.id + IF(a.id > 1000, 1000, 0)) as new_column2 FROM table a