1、保存数据文件至对象
select top 1000 * into temp
from _tianyaPWD
order by newid()
2、选择
select * from Student order by sdept,sage desc
--前者升序,后者降序
等于:select * from Student order by sdept,-sage
3、count语句等聚集函数
默认选择all,不取消重复值
select count(distinct sage) from Student
select avg(grade) from Sc where cno=1
多重条件语句:
select sum(ccredit) from sc,course
where sno='201215012' and sc.cno=course.cno
这里选择条件来自两个表,由于sno是sc表独有的列名,所以不需要加上前缀
第二个判断条件就是cno属性需要相同
4、groupby 语