1.用一条sql语句
select (case when a>b then a else b end ),(case when b>c then b esle c end) from table_name
2.当时我用了存储过程
创建存储过程
查询:exec 存储过程名 参数1,参数2,参数3
删除:drop procedure 存储过程名
SQL面试题: 数据库中有A B C三列,用SQL语句实现:当A列大于B列时选择A列否则选择B列 ,当B列大于C列时选择B列否则选择C列 ,
原文:http://www.cnblogs.com/qq3111901846/p/6410371.html