1 偏移
select top ncount * from table where (keyIndex not in ( select top noffset (keyIndex from table as table1 where +condition +")) and " + condition ;
举例吧: 这个是项目里面用到的,不想吧内容说太细
select top 20 LogID , RankID from Main_Log where( LogID not in ( select top 0 LogID from Main_Log as Log1 where 条件 +" )) and" +"条件" ;
2 多表查询
select a.xx ,b.yy,c.zz from table1 as a , table2 as b , table3 as c where a.xx=b.xx and b.xx = c.xx and c.xx = a.xx where a.xx = " condition";
3 求和
select sum(xx) from table
4排序
select xx from table order by xx
5计数
select count(*) from table where condition ;
6模糊查询
select * from table where value like '%a%';