0
在下表中,我有一個名爲ShortDesc的列和一個名爲LongDesc的列。如果ShortDesc不爲空,我想返回這個值。如果一行中的ShortDesc列爲空,我想返回LongDesc的值。如果ShortDesc和LongDesc都不爲空,我只想返回ShortDesc(LongDesc需要返回爲空)。只選擇非空列或一個特定列(如果兩者不爲空)
表活動
ID ShortDesc LongDesc
0 abc null
1 null def
2 ghi jkl
結果:
ID ShortDesc LongDesc
0 abc null
1 null def
2 ghi null
我不知如何爲此創造的SQL。