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

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

WBOY
Release: 2016-06-01 09:56:51
Original
920 people have browsed it

mysql select 语法:

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

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>
Copy after login

 

本网站相关知识:

mysql 教程

MySQL 查询数据

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template