码迷,mamicode.com
首页 > 数据库 > 详细

常用的一些mysql语句

时间:2017-03-31 10:25:58      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:roo   group   nbsp   ase   pre   class   drop   创建   mysq   

1、创建数据库

create database table;

2、删除数据库

drop database table;

3、去重筛选,示例:查询记录(name值相同的只保留一条)

select * from table group by name;

4、求总条数

select count(*) as totalcount from table;

 5、登陆mysql

mysql -uroot -p

 

常用的一些mysql语句

标签:roo   group   nbsp   ase   pre   class   drop   创建   mysq   

原文地址:http://www.cnblogs.com/yangye88/p/5893214.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!