HAVING函数的解释 [英] Explanation of HAVING Function

查看:97
本文介绍了HAVING函数的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我发布了一个问题来生成一个报告,该报告将拉出两个演员阵容常见的DVD标题。我的表名是ItemsCast,它链接了两个表(Items和Cast),该字段名为iccID。 NeoPa给我发了一个查询的SQL,就像魔法一样。但我只需要知道作为SQL一部分的HAVING函数的解释。有人可以解释一下这些条款:Min / Max以及它是如何工作的?整个SQL如下:我想知道第5行的解释。谢谢。

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

解决方案

我担心我不得不离开向NeoPa解释这一个。他显然想出了一种非常有创造性的方法,即使用HAVING子句来显示演员或导演演员ID出现在另一个项目中的所有结果。我担心我不能完全遵循他的所作所为,所以我会请他看看这个,希望我们都会学到一些东西:)


< a href =https://bytes.com/topic/access/answers/889312-explanation-having-function#post3577473 =nofollowclass =at_reply> @msquared


感谢您对此进行调查。看看代码,我可以说它是获得结果的创新方式。那个NeoPa是个天才!!!


如果我们从我建议的原始SQL开始,这将更容易解释和理解(参见通过表单查询参数)。很少有无关紧要的信息来混淆基本问题。我怀疑玛丽现在可能不需要解释,因为大多数混淆是SQL发布的复杂附加内容,以及行太长而无法完整显示的事实。

展开 < span class =codeDivider> | 选择 | Wrap | Line编号

Recently I posted a problem to generate a report which will pull titles of DVDs where two casts are common. My table name was ItemsCast which linked two tables (Items and Cast) and the field is called iccID. NeoPa sent me the SQL for a query which works like magic. But I just needed to know an explanation of the HAVING function that was a part of the SQL. Can someone please explain the terms: Min / Max and how it is working? The entire SQL is given below: I would like to know an explanation of line 5, please. Thanks.

Expand|Select|Wrap|Line Numbers

解决方案

I''m afraid I will have to leave the explanation on this one to NeoPa. He''s obviously come up with a very inventive way of using the HAVING clause to show all results for when the actor or director cast id appears in another item. I''m afraid I can''t follow exactly what he did though so I will ask him to take a look at this and hopefully we''ll both learn something :)


@msquared
Thanks for looking into it. Looking at the codes I can tell it''s an innovative way of getting the result. That NeoPa is a genius!!!


This will be much easier to explain and understand if we start with the original SQL I suggested (See Query parameters through a Form). There is little extraneous info to confuse the fundamental issue. I suspect Mary may not need the explanation now, as most of the confusion was the complicated extras in the SQL posted, and the fact that the lines are too long to show in their entirety.

Expand|Select|Wrap|Line Numbers


这篇关于HAVING函数的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆