SELECT CHOOSE((A>B)+2,A,B) AS result FROM T;
直接使用union好像可以实现俩表联合查询并去掉重复返回一个集把这个结果集再当成一个表SELECT NAME,COUNT(*) FROM (结果集语句) AGROUP BY NAME
SELECT CASE WHEN A > B THEN A ELSE B END AS RESULT FROM T