RE: error 8120 not contained aggregate function error
From: Mal .mullerjannie_at_hotmail.com> (.mullerjannie_at_hotmail.com)
Date: 10/06/04
- Next message: Alec MacLean: "Re: Dynamic column specification in table update"
- Previous message: simon: "Re: Derived tables"
- In reply to: Josema: "error 8120 not contained aggregate function error"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 6 Oct 2004 09:23:05 -0700
GROUP BY Clause
Specifies the groups into which output rows are to be placed and, if
aggregate functions are included in the SELECT clause <select list>,
calculates a summary value for each group. When GROUP BY is specified, either
each column in any non-aggregate expression in the select list should be
included in the GROUP BY list, or the GROUP BY expression must match exactly
the select list expression.
>From SQL helpfiles
"Josema" wrote:
> Hi to all,
>
> Im getting an error 8120:
> Column <column name> is invalid in the select list because it is not
> contained in either an aggregate function or the GROUP BY clause.
>
> In my procedure i want to select from two tables CCList and CCThemes some
> values, and all group by CCList.CalculationTheme
>
> CREATE PROCEDURE dbo.CC_GetCCByTheme
> @ThemeID int
> AS
> Select CCList.CalculationID, CCList.CalculationName, CCThemes.ThemeName,
> CCList.CalculationURL, CCList.CalculationDate, CCThemes.ThemeImage,
> CCList.CalculationClosed
>
> from CCList inner join CCThemes on CCThemes.ThemeID=CCList.CalculationTheme
>
> where CCList.CalculationTheme=@ThemeID Group By CCList.CalculationTheme
>
>
> Why this error its returning?
>
> --
> Thanks
> Regards.
> Josema
- Next message: Alec MacLean: "Re: Dynamic column specification in table update"
- Previous message: simon: "Re: Derived tables"
- In reply to: Josema: "error 8120 not contained aggregate function error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|