写法一:
select (case when tx=1111 then 1 when tx=2222 then 2 else 0 end) as txno from mytable;
写法二:
select (case tx when 1111 then 1 when 2222 then 2 else 0 end) as txno from mytable;
写法一:
select (case when tx=1111 then 1 when tx=2222 then 2 else 0 end) as txno from mytable;
写法二:
select (case tx when 1111 then 1 when 2222 then 2 else 0 end) as txno from mytable;