------------------------------------------
select (case when a>b then a else b end ),
(case when b>c then b esle c end)
from table_name
select (case when a>b then a else b end ),
(case when b>c then b esle c end)
from table_name
- drop table table1
- create table table1(
- a int,
- b int,
- c int
- )
- insert into table1 values(22,24,23)
- select * from table1
- select (case when a>b then a else b end),(case when b>c then b else c end)
- from table1
- select (case when a>b then a
- when a>c then a
- when b>c then b else c
- end)
- from table1