本文介绍了sql 2005中的case语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在我的查询条件中我正在过滤一个列名校园。如果校园是5,那么选择校园为5的记录,否则选择所有记录。如何写查询? 查询如: 选择代码,名称来自 table1 其中 campus =(//这里我想 实现逻辑) 解决方案 in my query in where condition i am filtering one column name campus.so if campus is 5 then select the record with campus as 5 otherwise select all records.how to write query?query like:select code,name from table1 where campus=(//here i want to implement the logic) 解决方案 这篇关于sql 2005中的case语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 19:42