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%';