立即学习:https://edu.csdn.net/course/play/24472/291786?utm_source=blogtoedu
select id,name,
(case when class id =20 then 6
when class id =6 then 20
else class id end) as A
from stu ;
select id,name,
(case when class id =20 then 6
when class id =6 then 20
else class id end) as A,class id
from stu ;
#也可以将原有的class id一起输出