sql注入语句示例大全_SQL Group By语句用示例语法解释
sql注入語(yǔ)句示例大全
GROUP BY gives us a way to combine rows and aggregate data.
GROUP BY為我們提供了一種合并行和匯總數(shù)據(jù)的方法。
The data used is from the campaign contributions data we’ve been using in some of these guides.
使用的數(shù)據(jù)來(lái)自我們?cè)谄渲幸恍┲改现幸恢笔褂玫膹V告系列貢獻(xiàn)數(shù)據(jù)。
The following SQL statement is answering the question: “which candidates received the largest total contributions in 2016 BUT only those that had more than $20 Million USD?”
以下SQL語(yǔ)句回答了這個(gè)問(wèn)題:“哪些候選人在2016年BUT中獲得的捐款最多,只有那些收入超過(guò)2000萬(wàn)美元的候選人?”
Ordering this data set in a descending (DESC) order places the candidates with the largest total contributions at the top of the list.
按降序(DESC)排序此數(shù)據(jù)集,將總貢獻(xiàn)最大的候選者放在列表的頂部。
SELECT Candidate, Election_year, sum(Total_$), count(*) FROM combined_party_data WHERE Election_year = 2016 GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first.+--------------------------------------------------+---------------+-------------------+----------+ | Candidate | Election_year | sum(Total_$) | count(*) | +--------------------------------------------------+---------------+-------------------+----------+ | CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | | TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | | SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | | CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | | CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | | RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | | BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | +--------------------------------------------------+---------------+-------------------+----------+ 7 rows in set (0.01 sec)As with all of these SQL things there is MUCH MORE to them than what’s in this introductory guide.
與所有這些SQL事物一樣,它們比本入門指南中的內(nèi)容要多得多。
I hope this at least gives you enough to get started.
我希望這至少能給您足夠的入門。
Please see the manual for your database manager and have fun trying different options yourself.
請(qǐng)參閱數(shù)據(jù)庫(kù)管理員的手冊(cè),并嘗試自己嘗試其他選項(xiàng),這很有趣。
翻譯自: https://www.freecodecamp.org/news/the-sql-group-by-statement-explained-with-example-syntax/
sql注入語(yǔ)句示例大全
總結(jié)
以上是生活随笔為你收集整理的sql注入语句示例大全_SQL Group By语句用示例语法解释的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 如何使用HTML,CSS和JavaScr
- 下一篇: form子句语法错误_用示例语法解释SQ