常用的一些mysql语句

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了常用的一些mysql语句相关的知识,希望对你有一定的参考价值。

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语句的主要内容,如果未能解决你的问题,请参考以下文章