select id,max(val) FROM (select id,a 列名 val from 表名unionselect id,b 列名 val from 表名unionselect id,c 列名 val from 表名)t 随便加个字段
求三列中最大数