博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
form子句语法错误_用示例语法解释SQL的子句
阅读量:2519 次
发布时间:2019-05-11

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

form子句语法错误

HAVING gives the DBA or SQL-using programmer a way to filter the data aggregated by the GROUP BY clause so that the user gets a limited set of records to view.

HAVING为DBA或使用SQL的程序员提供了一种过滤由GROUP BY子句聚合的数据的方法,以便用户可以查看一组有限的记录。

使用例 (Example of use)

The HAVING clause is like the WHERE clause, except it acts on the grouped data. In this case, the user will only see the largest amounts.

HAVING子句与WHERE子句类似,不同之处在于它对分组的数据起作用。 在这种情况下,用户只会看到最大的金额。

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

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

This SQL statement is answering the question: “which candidates received the largest total contributions in 2016 BUT only those that had more than 8$20 Million USD?”

该SQL语句回答了以下问题:“哪些候选人在2016年BUT中获得的捐款最多,只有那些收入超过8千万美元的候选人?”

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.

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

翻译自:

form子句语法错误

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

你可能感兴趣的文章
使用Postmark测试后端存储性能
查看>>
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
ATMEGA16 IOport相关汇总
查看>>
JAVA基础-多线程
查看>>
面试题5:字符串替换空格
查看>>
[Codevs] 线段树练习5
查看>>
Amazon
查看>>
component-based scene model
查看>>
Echart输出图形
查看>>
hMailServer搭建简单邮件系统
查看>>
从零开始学习jQuery
查看>>
Spring+SpringMVC+MyBatis深入学习及搭建(四)——MyBatis输入映射与输出映射
查看>>
opacity半透明兼容ie8。。。。ie8半透明
查看>>
CDOJ_24 八球胜负
查看>>
Alpha 冲刺 (7/10)
查看>>
一款jQuery打造的具有多功能切换的幻灯片特效
查看>>
SNMP从入门到开发:进阶篇
查看>>
@ServletComponentScan ,@ComponentScan,@Configuration 解析
查看>>
unity3d 射弹基础案例代码分析
查看>>