In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "mysql how to query multiple fields", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "mysql how to query multiple fields" bar!
In mysql, you can use select statement to query multiple field data, syntax "SELECT field name 1, field name 2, field name n FROM data table name [WHERE clause];"; multiple field names need to be separated by English commas.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In MySQL, you can use SELECT statements to query data. Query data refers to the use of different query methods to obtain different data from the database according to the requirements, which is the most frequent and important operation.
Want to query a field specified in the table
The syntax format for a field in the query table is:
SELECT column name FROM table name [WHERE clause]
Example
Query the names of all the students in the name column in the tb_students_info table, and the SQL statement and run results are shown below.
Mysql > SELECT name FROM tb_students_info;+-+ | name | +-+ | Dany | | Green | | Henry | | Jane | | Jim | | John | | Lily | | Susan | | Thomas | | Tom | +-+ 10 rows in set (0.00 sec)
The output shows all the data under the name field in the tb_students_info table.
Want to query multiple fields specified in the table
You can use the SELECT declaration to obtain the data under multiple fields. You only need to specify the field name to be looked up after the keyword SELECT. Different field names are separated by commas "and". There is no need to add a comma after the last field. The syntax format is as follows:
SELECT field name 1, field name 2, … , field name n FROM table name [WHERE clause]
Example
Get the id, name, and height columns from the tb_students_info table, and the SQL statement and run results are shown below.
Mysql > SELECT id,name,height-> FROM tb_students_info + -. | 178 | 10 | Tom | 165 | +-+ 10 rows in set (0.00 sec)
The output shows all the data under the id, name, and height fields in the tb_students_info table.
Thank you for your reading, the above is the content of "mysql how to query multiple fields", after the study of this article, I believe you have a deeper understanding of how to query multiple fields of mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 245
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.