MySQL uses the select statement to query the data of the specified column (field) in the specified table.

Source: Internet
Author: User

MySQL uses the select statement to query the data of the specified column (field) in the specified table.

This article describes how to execute a select query statement in the MySQL database to query the data of a specified column, that is, the data of a specified field.

Let's review the select statement syntax in the SQL statement:

Basic syntax of the Select statement:

Select <column set> from <Table Name> where <condition> order by <sorting field and method>

To query all the data of a specified column in a table, you can write the query statement:

Select column name 1, column name 2, column name 3... from <Table Name>

To describe one, you can still use the where clause after this statement to select the specified column of the specified row. In this way, you can query the expected results more accurately.

The following example shows how to query the data of the t_name and t_birth fields in the test table and match the row t_name = 'name2 ':

Mysql> select t_name, t_birth from test where t_name = 'name2 ';
+ ------- + ------------ +
| T_name | t_birth |
+ ------- + ------------ +
| Name2 | 2013-01-01 |
+ ------- + ------------ +
1 rows in set (0.00 sec)

This article describes how MySQL uses the select statement to query the data of the specified columns (fields) in a specified table. It is helpful to everyone. Thank you!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.