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!