Home >Database >Mysql Tutorial >mysql select 从表中检索或查询数据

mysql select 从表中检索或查询数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 09:56:51941browse

mysql select 语法:

<code class="language-sql">SELECT what_to_select
FROM which_table
WHERE conditions_to_satisfy;</code>

what_to_select是你想看到的东西,可以是数据库表中的列名,*表示“所有列”。

which_table是表名。

WHERE子句是可选的,如果WHERE子句存在,conditions_to_satisfy指定行必须满足的条件。

 

mysql select实例

下面实例从user 表中查询出列name和sex的信息,并且查询条件是满足sex=1.

<code class="language-sql">SELECT name,sex
FROM user
WHERE sex=1;</code>

 

本网站相关知识:

mysql 教程

MySQL 查询数据

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn