同桌上课用手指进去了好爽_欧美丰满熟妇xxⅹⅹ性大i_成人av天天日天天拍拍_猛男gay帅男gay男男同志_欧美va天堂在线观看_人妻无码av中文系列三里桃花_亚欧免费无码在线观看_久久久精品国产亚洲av水_日韩在线免费看污污污_2021无码专区人妻系列日韩

首頁 優(yōu)化推廣 經典SQL語句大全之提升篇

經典SQL語句大全之提升篇

來源: | 時間:2011/4/15 15:51:19 |

1、復制表(只復制結構,源表名:a 新表名:b)

SQL Server:select * into b from a where 1<>1
Access:
select top 0 * into b from a

2、拷貝表(拷貝數(shù)據(jù),源表名:a 目標表名:b) (Access可用)

insert into b(a, b, c) select d,e,f from b;

3、跨數(shù)據(jù)庫之間表的拷貝(具體數(shù)據(jù)使用絕對路徑) (Access可用)
insert into b(a, b, c) select d,e,f from b in ‘具體數(shù)據(jù)庫’ where 條件

insert into b(a, b, c) select d,e,f from b in "&Server.MapPath(".")&"\data.mdb" &" where 條件

4、子查詢(表名1:a 表名2:b)

select a,b,c from a where a IN (select d from b ) 或者: select a,b,c from a where a IN (1,2,3)

5、顯示文章、提交人和最后回復時間

select a.title,a.username,b.adddate from table a,(select max(adddate) adddate from table where table.title=a.title) b

6、外連接查詢(表名1:a 表名2:b)

select a.a, a.b, a.c, b.c, b.d, b.f from a LEFT OUT JOIN b ON a.a = b.c

7、在線視圖查詢(表名1:a )

select * from (SELECT a,b,c FROM a) T where t.a >
TAG:高端網站建設高端網站設計網站制作網站建設

服務熱線

153 8323 9821

功能和特性

價格和優(yōu)惠

網站和維護

推廣和優(yōu)化

微信服務號