Select a column if other column is null

后端 未结 7 757
庸人自扰
庸人自扰 2020-12-08 13:14

I need to select a field called ProgramID from a table and if the ProgramID is NULL then I need to select the value in the InterimProgramID from the same table and alias it

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 13:46

    Coalesce('zzz-' + ProgramID, InterimID) as programID will still ignore ProgramID even if you have a pretext value. It's a cool little function

提交回复
热议问题