In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In the process of mysql query, data can be filtered, sorted and grouped. Examples of sorted data and grouped data are described below. 1. The data is sorted using ORDER BY select * from where id=10 order by id (positive order, inverted order) positive ASC reverse order DESC from small to small 2, and the grouped data GROUP BY HAVING GROUP BY clause groups a set of rows into summary row records of a small group by the value of a column or expression. The GROUP BY clause returns a row for each packet. In other words, it reduces the number of rows in the result set.
The GROUP BY clause is often used with aggregate functions, such as SUM,AVG,MAX,MIN and COUNT. Aggregate functions are used in the SELECT clause to calculate information about each group.
HAVING can query (filter) which orders have total sales greater than 55000 by using the having clause, as follows:
SELECT
Ordernumber
SUM (quantityOrdered) AS itemsCount
SUM (priceeach*quantityOrdered) AS total
FROM
Orderdetails
GROUP BY ordernumber
HAVING total > 55000
Article from (www.dc3688.com)
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.