检索数据select
-
检索单个列:select name from stu;
-
检索多个列:select id,name,age,sex,from,stu;
-
检索所有列:select * from stu;
-
检索不同的行DISTINCT(个人理解去重的意思)
- select distinct classid from stu;
-
限制结果LIMIT:
- select * from stu limit 3,4;
- select *from stu limit 3;(含义是检索前三条数据)
-
使用完全限定的表名
目录
检索多个列:select id,name,age,sex,from,stu;
- select name from stu;
- select stu.name from stu;
- select stu.name from chuange.stu;