1 create table P19
2 查询顺序
From, where, group,having ,select ,order
3 distinct删除重复的行4
4 case
When val <1000 then ‘less than 1000’
When val between 1000 and 3000 then ‘between 1000 and 3000’
Else ‘unknown’
End as valuecategory
5 z字符串处理 69
6处理时间和日期 75
7 order by ,distinct不可以一起用 43-TSQL
子查询:
In,between ,not in
Select * from a where a.id in(select * from b.id=’a’ where ……)
8 pivoting 3个阶段 :分组,扩展,聚合