真的头痛啊。为此语句,这样记忆最好,如下:
遇到 XXX情况 就 XXX 遇不到就 XXX 结束
case when …… then …… else …… end
实例一:我们都知道SQL中适用case when then来转化数据库中的信息 比如
select (case sex when 0 then '男' else '女' end) AS sex from studentInfo
SELECT id,number, (case hblfile when '' then 0 else 1 end) as hblfile, (case hbltxlfile when '' then 0 else 1 end) as hbltxlfile, (case mblfile when '' then 0 else 1 end) as mblfile FROM `file` where number = '2012050002' group by hblfile,hbltxlfile,mblfile
内外连接区别: http://zhidao.baidu.com/question/80758682.html
SQL中 inner join、 left join 、right join、 outer join之间的区别点击打开链接
本文介绍如何使用 SQL 中的 CASE WHEN THEN 语句进行条件判断和转换数据。通过具体示例展示如何将数据库中的特定值转换为更易于理解的形式,并解释了 CASE WHEN THEN 语句的基本语法。
965

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



