mysql基础语句
2015-03-03 15:55
218 查看
1、查询:select * from table where 条件 select * from watch.user; // 跨库查询,查询watch库user表
2、插入:insert into table(字段1,字段2) values(值1,值2)
3、删除:delete from table where 条件
4、更新:update table set 字段=值 where 条件
5、查找:select * from table where 字段 like ’%value%’
6、排序:select * from table order by 字段 asc(默认)/desc 7、总数:select count(*)/count(字段) from table
8、求和:select sum(字段) from table
9、平均:select avg(字段) from table
10、最大:select max(字段) from table
11、最小:select min(字段) from table
本文出自 “天好” 博客,请务必保留此出处http://tianhaoblog.blog.51cto.com/6467511/1616890
2、插入:insert into table(字段1,字段2) values(值1,值2)
3、删除:delete from table where 条件
4、更新:update table set 字段=值 where 条件
5、查找:select * from table where 字段 like ’%value%’
6、排序:select * from table order by 字段 asc(默认)/desc 7、总数:select count(*)/count(字段) from table
8、求和:select sum(字段) from table
9、平均:select avg(字段) from table
10、最大:select max(字段) from table
11、最小:select min(字段) from table
本文出自 “天好” 博客,请务必保留此出处http://tianhaoblog.blog.51cto.com/6467511/1616890
相关文章推荐
- Mysql中id自增的基础语句
- MySQL的部分基础语句
- MySql 基础知识-常用命令及sql语句
- mysql基础语句整理
- MySQL基础----动态SQL语句
- PHP 分页的实现的理论基础---MySQl的limit语句和count(*)语句 [原创]
- mysql数据中sql语句基础大全
- mysql基础之操作语句
- mysql基础-- 一条请求执行多条SQL语句
- MySQL基础教程14 —— SQL语法之数据定义语句DDL
- mySQL基础语句复习(二)
- MySQL的部分基础语句
- mysql语句查询基础
- mysql 基础操作 sql语句
- PHP基础之函数(二)----Mysql语句,服务器函数
- mysql基础语句(少部分)(No.9)
- mysql 基础ddl语句 dml语句
- php操作mysql语句基础应用
- Mysql语句基础
- MySQL基础教程15 —— SQL语法之数据操作语句DML——DELETE语法