Select a column if other column is null

后端 未结 7 730
庸人自扰
庸人自扰 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:53

    You can also use IFNULL function

    select IFNULL(ProgramId,interimId) as ProgramId
    
    0 讨论(0)
提交回复
热议问题