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