In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail the example analysis of the retrieval data in MySQL. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
MySQL is not case-sensitive, but try to make keywords uppercase, column and indication lowercase, easy to read and debug.
SQL statement, all spaces are ignored. The SQL statement can be given on the previous line or divided into many lines. In general, it is written in multiple lines.
Automatic increment:
Some lists require unique values, and MySQL can automatically assign an available number to each row instead of manually assigning a unique value as each row is added.
DESCRIBE = SHOW COLUMNS FROM
DESCRIBE is supported as a shortcut to SHOW COLUMNS FROM in MySQL. For example:
Equivalent to
Unsorted data:
In MySQL, the order of the returned data is meaningless if the structure of the sorted query is not clearly defined. It is normal as long as the same number of rows are returned.
When retrieving multiple columns, be sure to add anything after the column name, but not the last one.
Retrieve all columns:
Given the wildcard *, all columns are returned.
You don't usually use wildcards to retrieve all columns, but you can use them to retrieve columns with unknown names if you don't explicitly specify a column name.
SELECT returns all matching rows.
All the values in a row have been retrieved (there are duplicates), so how to remove them? DISTINCT, which only returns different values.
LIMIT 5 indicates that no more than 5 lines of SELECT are returned
LIMIT 5 5 means that MySQL returns five rows starting from line 5; the first number is the start position, and the second number is the number of rows to retrieve.
Note:
(1) LIMIT with a value always starts from the first line, and the number given is the number of rows returned; with two worthy LIMIT, you can specify to start at the position where the line number is the first value.
(2) the first behavior retrieved is row 0 instead of row 1 (this is the same as the array); so LIMIT 1 retrieves the second row instead of the first row.
(3) if the number of rows is not enough (for example, LIMIT 10J5 but there are only 13 rows in total), MySQL will return the most rows it can return.
Above the MySQL5 version:
LIMIT 3 OFFSET 4 = = LIMIT 4 OFFSET 3 # take 4 lines from line 3
This is the end of the article on "sample analysis of retrieved data in MySQL". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.