sql 語句

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

 

發佈了23 篇原創文章 · 獲贊 0 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章