- 1. select field1,
- 2. (case
- 3. when condition then dosomthing
- 4. when condition then dosomthing
- 5. else dosomthing
- 6. end) fieldname
- 7. from tablename
- 8.
- 9. --或者在products、tigger和function中也可以使用
sqlserver 中 case 的用法
本文介绍了一种在SQL查询中常用的Case表达式的使用方法,包括基本语法和应用场景。通过Case表达式可以根据不同的条件返回不同的结果,适用于产品、触发器和函数等多种场景。

被折叠的 条评论
为什么被折叠?



