2011年10月31日 星期一

Access的類似Case的用法


SELECT
IIf(DataClockPlay.PlayType=0,"flash", IIf(DataClockPlay.PlayType=1,"web", IIf(DataClockPlay.PlayType=2,"movie",IIf(DataClockPlay.PlayType=3,"aa",
IIf(DataClockPlay.PlayType=4,"test",IIf(DataClockPlay.PlayType=5,"news",
IIf(DataClockPlay.PlayType=6,"ff")))))))

FROM DataClockPlay;

Access 沒有Case,所以可用IIF

沒有留言: