您的位置:首页 > 数据库 > MySQL

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: