select case status when 1 then '成功' when 2 then '失敗' else '其他' end from user
- case后面緊跟要被作為判斷的字段
- when后面跟判斷條件
- then后面跟結果
- else相當於default
- end是語句結束語
來源:https://blog.csdn.net/u012150370/article/details/50505408
select case status when 1 then '成功' when 2 then '失敗' else '其他' end from user
來源:https://blog.csdn.net/u012150370/article/details/50505408
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。