幾個(gè)簡單的基本的sql語句
更新時(shí)間:2010年02月13日 16:05:03 作者:
這個(gè)是從網(wǎng)上看到的。。。COPY一下。。有時(shí)候忘記了。。
說明:幾個(gè)簡單的基本的sql語句
選擇:select * from table1 where 范圍
插入:insert into table1(field1,field2) values(value1,value2)
刪除:delete from table1 where 范圍
更新:update table1 set field1=value1 where 范圍
查找:select * from table1 where field1 like '%value1%' ---like的語法很精妙,查資料!
排序:select * from table1 order by field1,field2 [desc]
總數(shù):select count * as totalcount from table1
求和:select sum(field1) as sumvalue from table1
平均:select avg(field1) as avgvalue from table1
最大:select max(field1) as maxvalue from table1
最小:select min(field1) as minvalue from table1
選擇:select * from table1 where 范圍
插入:insert into table1(field1,field2) values(value1,value2)
刪除:delete from table1 where 范圍
更新:update table1 set field1=value1 where 范圍
查找:select * from table1 where field1 like '%value1%' ---like的語法很精妙,查資料!
排序:select * from table1 order by field1,field2 [desc]
總數(shù):select count * as totalcount from table1
求和:select sum(field1) as sumvalue from table1
平均:select avg(field1) as avgvalue from table1
最大:select max(field1) as maxvalue from table1
最小:select min(field1) as minvalue from table1
相關(guān)文章
恢復(fù)sql server 2000誤刪數(shù)據(jù)的解決辦法
這篇文章主要介紹了恢復(fù)sql server 2000誤刪數(shù)據(jù)的解決辦法,需要的朋友可以參考下2015-09-09
SQL?Server數(shù)據(jù)庫數(shù)據(jù)文件的遷移步驟
最近有朋友問我如何將一臺(tái)電腦中的SQL Server數(shù)據(jù)庫數(shù)據(jù)文件遷移到另一臺(tái)電腦上,在這給大家分享SQL?Server數(shù)據(jù)庫數(shù)據(jù)文件的遷移步驟,感興趣的朋友一起看看吧2024-03-03
在SQL Server中查詢資料庫的TABLE數(shù)量與名稱的sql語句
這篇文章主要介紹了在SQL Server中查詢資料庫的TABLE數(shù)量與名稱的sql語句,需要的朋友可以參考下2014-04-04
SQL Server數(shù)據(jù)庫日志查看若已滿需要清理的三種解決方案
因?yàn)閿?shù)據(jù)量較大,對(duì)數(shù)據(jù)庫表操作比較多,日志的模式,又是完全模式,所以會(huì)產(chǎn)生較大的日志文件,那么怎么清理呢,本文給大家介紹了SQL Server數(shù)據(jù)庫日志查看若已滿需要清理的三種解決方案,需要的朋友可以參考下2024-04-04
SQL?Server表空間碎片化回收的實(shí)現(xiàn)
本文主要介紹了SQL?Server表空間碎片化回收的實(shí)現(xiàn),文中根據(jù)實(shí)例編碼詳細(xì)介紹的十分詳盡,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-03-03

