1、limit 语句
限制返回的行数
2、列别名
count(1) as times
3、嵌套select语句
select xxx from (select xx from table1 ) a ;
4、case ...when ...then语句
用户处理单个列的查询结果
select name,
case
when salay <50000 then 'low'
when salay >=50000 and salary <70000 then 'middle'
else 'high'
end as bracket from employee;
本文深入讲解SQL的高级应用,包括limit语句控制结果集大小,使用列别名简化查询结果展示,通过嵌套select实现复杂数据筛选,以及利用case...when...then进行条件判断,提升查询灵活性。
2082

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



