几条简单而且实用的SQL语言:
1. 选出每X-Y条记录(按某个条件排序)
select top (y-x) * from (select top y * from table order by id) a order by id desc
2. 先出符合打件的记录数
select conunt(*) from table where
3. 选取***ID号
select max(ID) from table
select top 1 id from table order by id desc
4. 按字段1统计字段2
select count(字段2) from table group by 字段1
select sum(字段2) from table group by 字段1
5. 选取不重复记录
select distinct 字段 from table
【编辑推荐】