Let's review the syntax of select statement in SQL statement:
choose
Basic syntax of the statement:
choose
& lt column set >;
from
& lt table name >
where
& lt condition >
order
pass by
& lt sort fields and methods >
If you want to query all the data of the specified column in the table, the query statement can be written as:
choose
Column name 1, column name 2, column name 3. ...
from
& lt table name >
For example, you can still use the where clause after the statement to select the specified column of the specified row. In this way, the required results can be queried more accurately.
Let's take a look at an example. We query the data of two fields, t_name and t_birth, in a test table, and match it to row t_name='name2':
mysql & gt
choose
Name, birth
from
test
where
t _ name = ' name2
+ - + - +
|
name
|
T _ birth
|
+ - + - +
|
Name 2
|
20 13-0 1-0 1
|
+ - + - +
1
line
exist
set up
(0.00
Seconds)
About MySQL using select statement to query the data of the specified column (field) in the specified table, this article introduces so much, hoping to help everyone, thank you!