Home Forums SQL Server 2008 SQL Server Newbies Column 'Basic_Data.School_Year' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. RE: Column 'Basic_Data.School_Year' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

  • Ashish Dutt (12/11/2014)


    Thanks Eirikur for your response.

    But I'm greeted with the following error on executing the query you posted.

    Msg 102, Level 15, State 1, Line 13

    Incorrect syntax near 'b'.

    The error i get is apparently at this location

    use MICE

    SELECT

    *

    into School_Perform_Data_2020

    FROM

    (

    select

    ROW_NUMBER() OVER

    (

    PARTITION BY e.School_Code,f.acyear,f.FcID,f.School_code,e.erID,g.acyear,g.GenID,t.acyear,t.School_Code

    ORDER BY (SELECT NULL)

    ) AS DD_RID

    b.School_Year, ----> here it doesnt recognise the object b.

    Missing comma

    😎