博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sql注入语句示例大全_SQL Group By语句用示例语法解释
阅读量:2518 次
发布时间:2019-05-11

本文共 2476 字,大约阅读时间需要 8 分钟。

sql注入语句示例大全

GROUP BY gives us a way to combine rows and aggregate data.

GROUP BY为我们提供了一种合并行和汇总数据的方法。

The data used is from the campaign contributions data we’ve been using in some of these guides.

使用的数据来自我们在其中一些指南中一直使用的广告系列贡献数据。

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语句回答了这个问题:“哪些候选人在2016年BUT中获得的捐款最多,只有那些收入超过2000万美元的候选人?”

Ordering this data set in a descending (DESC) order places the candidates with the largest total contributions at the top of the list.

按降序(DESC)排序此数据集,将总贡献最大的候选者放在列表的顶部。

SELECT Candidate, Election_year, sum(Total_$), count(*)FROM combined_party_dataWHERE Election_year = 2016GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columnsHAVING 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事物一样,它们比本入门指南中的内容要多得多。

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.

请参阅数据库管理员的手册,并尝试自己尝试其他选项,这很有趣。

翻译自:

sql注入语句示例大全

转载地址:http://mqrwd.baihongyu.com/

你可能感兴趣的文章
黑马程序员_java基础笔记(02)...java语言基础组成
查看>>
关于缓存击穿
查看>>
对innodb 拷贝文件实现数据库的方式(转)
查看>>
python知识点 2014-07-09
查看>>
FloatingActionButton的一点学习感悟
查看>>
ABAP CDS ON HANA-(10)項目結合して一つ項目として表示
查看>>
网站地址信息
查看>>
产品经理 - 登录 注册
查看>>
小白的python进阶历程------05.占位符
查看>>
CF414BMashmokh and ACMDP
查看>>
Notepad++ 通过g++编译
查看>>
JAVA基础2——类初始化相关执行顺序
查看>>
转:Zend Framework 重定向方法(render, forward, redirect)
查看>>
Linux下查看磁盘与目录的容量——df、du
查看>>
关于日记app的思考
查看>>
使用sencha的cmd创建项目时提示找不到\Sencha\Cmd\repo\.sencha\codegen.json
查看>>
如何快速启动一个Java Web编程框架
查看>>
MSP430单片机存储器结构总结
查看>>
文本框过滤特殊符号
查看>>
教育行业安全无线网络解决方案
查看>>