检索语句
select xxxx from yyyy; 从yyyy表中检索出xxxx列(可以同时检索多列,中间用逗号隔开)
![](https://img.haomeiwen.com/i8836269/0e2f75dfd0a855f5.png)
select * from yyyy; (用通配符*来同时检索所有列)
![](https://img.haomeiwen.com/i8836269/8b63af22bd0d6f67.png)
select distinct xxxx from yyyy; (可以检索该列出不同值的行)
![](https://img.haomeiwen.com/i8836269/76284af53786364e.png)
select firstname from employees limit 5;(返回从第0行(即第一行)开始的五行)
![](https://img.haomeiwen.com/i8836269/90bcc99293d40dcc.png)
select firstname from employees limit 2,4; (返回从第二行开始的四行)
![](https://img.haomeiwen.com/i8836269/c75899d5e62b513e.png)
select employees.firstname from yiibaidb.employees; (限定数据库名和限定表名(无需))
![](https://img.haomeiwen.com/i8836269/68e418566e899d9c.png)
网友评论