幾個簡單的基本的sql語句
更新時間:2010年02月13日 16:05:03 作者:
這個是從網(wǎng)上看到的。。。COPY一下。。有時候忘記了。。
說明:幾個簡單的基本的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
最?。簊elect 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
最?。簊elect min(field1) as minvalue from table1
相關(guān)文章
分頁存儲過程(二)在sqlserver中返回更加準(zhǔn)確的分頁結(jié)果
分頁存儲過程(二)在MS SQL Server中返回更加準(zhǔn)確的分頁結(jié)果2010-05-05insert into select和select into的使用和區(qū)別介紹
insert into ... select 和 select ... into的使用上有哪些區(qū)別呢?在本文將為大家下詳細(xì)介紹下,不知道的朋友可以了解下2013-09-09SQL 無法裝載DLL Microsoft原因(無法修改sa密碼)
無法裝載 DLL Microsoft提示您請誤隨意操作SQL數(shù)據(jù)庫 以免對起 數(shù)據(jù)庫造成不必要的麻煩 或該 DLL 所引用的某一 DLL。原因: 126(找不到指定的模塊2012-07-07sql server 2000中禁止創(chuàng)建表(權(quán)限設(shè)置方法)
最近發(fā)現(xiàn)數(shù)據(jù)庫中發(fā)現(xiàn)了三個臨時表,為了安全這里為大家分享下sql server 2000中禁止創(chuàng)建表的方法,網(wǎng)上都么有的,腳本之家小編原創(chuàng)2015-07-07sql時間段切分實現(xiàn)每隔x分鐘出一份高速門架車流量
本文主要介紹了sql時間段切分實現(xiàn)每隔x分鐘出一份高速門架車流量,文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-02-02SQL Server 2012 FileTable 新特性詳解
FileTable是基于FILESTREAM的一個特性。本文給大家介紹SQL Server 2012 FileTable 新特性詳解,非常不錯,感興趣的朋友一起學(xué)習(xí)吧2016-08-08遠(yuǎn)程登陸SQL Server 2014數(shù)據(jù)庫的方法
這篇文章主要為大家詳細(xì)介紹了遠(yuǎn)程登陸SQL Server 2014數(shù)據(jù)庫的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08