SQLServer 經常使用的基本語法

選擇: select * from table1 where 範圍html

插入: insert into table1(field1,field2) values(value1,value2)spa

刪除: delete from table1 where 範圍htm

更新: update table1 set field1=value1 where 範圍blog

查找: select * from table1 where field1 like ’%value1%’ ---like的語法很精妙,查資料!排序

排序: select * from table1 order by field1,field2 [desc]table

總數: select count as totalcount from table1date

求和: select sum(field1) as sumvalue from table1select

平均: select avg(field1) as avgvalue from table1語法

最大: select max(field1) as maxvalue from table1tab

最小: select min(field1) as minvalue from table1

原文出處:https://www.cnblogs.com/panxinxian/p/11664199.html

相關文章
相關標籤/搜索