In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how mysql queries the value of a certain field". The explanation in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian and go deep into it slowly to study and learn "how mysql queries the value of a certain field" together!
In mysql, you can query the value of a field using a SELECT statement with a specified field name, syntax "SELECT field name FROM table name WHERE clause LIMIT clause;".
Operating environment of this tutorial: Windows 7 system, MySQL8 version, Dell G3 computer.
In mysql, you can query the value of a field using SELECT statements with a specified field name.
The syntax format of a field in the query table is:
SELECT COLUMN FROM TABLE NAME [WHERE [GROUP BY [HAVING [{ }…]][ORDER BY ][LIMIT[,] ]]
WHERE is optional. If selected, the query data must satisfy the query criteria.
GROUP BY
< 字段 >This clause tells MySQL how to display the queried data grouped by the specified fields.
[ORDER BY
< 字段 >], this clause tells MySQL in what order to display the query data, can be sorted in ascending order (ASC) and descending order (DESC), the default is ascending order.
[LIMIT[,]], which tells MySQL how many pieces of data to display at a time.
Example 1:
Query the names of all students in the name column of the tb_students_info table. The SQL statement and the running result are as follows.
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.
You can use SELECT declaration to obtain data under multiple fields. You only need to specify the name of the field you want to find after the keyword SELECT. Different field names are separated by commas. There is no need to add commas after the last field. The syntax format is as follows:
SELECT ,,…, FROM ;
Example 2:
Get the id, name and height columns from tb_students_info table. SQL statement and running result are shown below.
mysql> SELECT id,name,height -> FROM tb_students_info;+----+--------+--------+| id | name | height |+----+--------+--------+| 1 | Dany | 160 || 2 | Green | 158 || 3 | Henry | 185 || 4 | Jane | 162 || 5 | Jim | 175 || 6 | John | 172 || 7 | Lily | 165 || 8 | Susan | 170 || 9 | Thomas | 178 || 10 | Tom | 165 |+----+--------+--------+10 rows in set (0.00 sec)
The output shows all the data in the tb_students_info table under the id, name, and height fields.
Thank you for reading, the above is "mysql how to query the value of a field" content, after the study of this article, I believe we have a deeper understanding of how mysql queries the value of a field, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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: 0
*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.