记几个简单常用的SQL语句=u=,划水划水划水~
显示所有的数据库
show databases;
进入adatabase这个数据库
use adatabase;
显示所有的表
show tables;
显示某张表的结构
desc atable;
检索a这个列
select a from atable;
检索a,b,c三个列
select a,b,c from atable;
检索a这个列并当b='123'的时候
select a from atable where b='123';
检索a这个列并按a分组统计
select a,count(*) from atable group by a;
检索a这个列不同的行
select distinct a from atable;
检索a这个列前10行
select a from atable limit 10;
检索a这个列从11行开始往后5行
select a from atable limit 11,5;