Column ‘dbo.Class2.ID’ is invalid in the select list because it is not contained in either an aggregate function or the group by claus
I am trying to create a Sql function,Where a list of students is fetched by specifying their class status.I could create a function to retrieve such an information for a single user,But when i tried to get a list for all of them i get this error.
This is my Functions declaration in Sql: