您现在的位置是:网站首页> 编程资料编程资料
几个简单的基本的sql语句_MsSql_
2023-05-26
357人已围观
简介 几个简单的基本的sql语句_MsSql_
说明:几个简单的基本的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]
总数: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]
总数: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
相关内容
- 得到自增列的下一个会插入的id_MsSql_
- Godaddy 导入导出MSSQL数据库的实现步骤_MsSql_
- GridView自定义分页的四种存储过程_MsSql_
- MSSQL 数据库备份和还原的几种方法 图文教程_MsSql_
- sql 分组查询问题_MsSql_
- Sql2000数据库的备份文件恢复到Sql2005的方法_MsSql_
- 做购物车系统时利用到得几个sqlserver 存储过程_MsSql_
- sql 判断数据库,表,存储过程等是否存在的代码_MsSql_
- sqlserver substring函数使用方法小结_MsSql_
- sqlserver exists,not exists的用法_MsSql_