cuijinlong

select A.return_car_area, case when A.return_car_area=\'\' THEN 0 ELSE 1 END from t_base_Bq_branch A

 

select A.return_car_area, case A.return_car_area when \'\' THEN 0 ELSE 1 END from t_base_Bq_branch A

当这个字段return_car_area为空串的时候显示 0 否则显示1   case when 字段=条件  then 赋值 else 赋值 end

 

select IFNULL(b.tobranchID,9999) from t_base_task b

当tobranchID为null时显示 9999 否则显示数据库值   IFNULL(字段,赋值) 当字段为空是赋值

 

  IFNULL(
  CASE c.tasktype
  WHEN 0 THEN (SELECT bpl.name FROM t_base_Bq_branch bpl WHERE c.stationId = bpl.rail_id )
  WHEN 1 THEN (SELECT bpl.name FROM t_base_Bq_branch bpl WHERE c.stationId = bpl.rail_id ) ELSE \'\' END ,\'\') toPark

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
  • 2022-12-23
  • 2021-12-10
  • 2021-12-20
猜你喜欢
  • 2021-11-02
  • 2021-08-13
  • 2022-01-12
  • 2021-09-03
  • 2021-11-16
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案