select case when a.maxnum > 另一个值 then a.maxnum+1 when a.maxnum < 另一个值 then 另一个值 endfrom ( select max(字段) as maxnum from table) a只能在php中查出来
select max(字段) from table