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.
Code:
SELECT ItemsCast.iciID, Items.iNo, Items.iTitle, Items.iID, Items.SubTitle, Items.Year, Items.Color, Items.Note, Category.cgAbbv, Language.lName, Format.fAbbv, Type.tName FROM ([Language] INNER JOIN (Type INNER JOIN (Format INNER JOIN (Category INNER JOIN Items ON Category.cgID = Items.cgID) ON Format.fID = Items.fID) ON Type.tID = Items.tID) ON Language.lID = Items.lID) INNER JOIN ItemsCast ON Items.iID = ItemsCast.iciID WHERE (((ItemsCast.iccID) In ([Forms].[fReportList].[txtDirector],[Forms].[fReportList].[txtActor]))) GROUP BY ItemsCast.iciID, Items.iNo, Items.iTitle, Items.iID, Items.SubTitle, Items.Year, Items.Color, Items.Note, Category.cgAbbv, Language.lName, Format.fAbbv, Type.tName HAVING (((Min(ItemsCast.iccID))<Max([iccID])));
Comment