MySQL-select case when

#1:硬座价格,#0软座价格
select case when 1=0 then HardSeatPrice else SoftSeatPrice end from tb_train_schedule
where StartStationID=(select id from tb_train_station where name like "%广州%")
and EndStationID=(select id from tb_train_station where name like "%长沙%");
 

你可能感兴趣的:(mysql)