Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 15893 |  Welcome, Guest!   Register  Login
 Home > Coding Horrors > SQL Server > Column 'STUDENTS.ID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. ...
Sqldev

Column 'STUDENTS.ID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

 Coding Horror posted by: Sqldev | Posted on: 5/1/2012 | Category: SQL Server | Views: 3898 | Level: Starter | Status: [Member] | Points: 75 | Alert Moderator   



Its a general group by Error.

Solution for this error




Found interesting? Add this to:


Experience:8 year(s)
Home page:http://learnsqltips.blogspot.in/
Member since:Thursday, April 19, 2012
Level:Starter
Status: [Member]
Biography:
 Responses
Montysahu
Posted by: Montysahu | Posted on: 6/22/2012 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

Hi..

I am not understand what you want to say..

Can u share your sql script.

Montysahu
Posted by: Montysahu | Posted on: 6/22/2012 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

Hi.

Sql Script : SELECT SUBJECT, ID,NAME FROM STUDENTS GROUP BY SUBJECT

In the above script you are using GROUP BY clause. From Sql concept if u r using GROUP BY clause then u have to using any aggregate function like sum,avg..etc.

i think your above query like this
SELECT ID,NAME,sum(MARKS) FROM STUDENTS GROUP BY Name

Please give me replay..if u want something more..


Kumardeepak32
Posted by: Kumardeepak32 | Posted on: 10/17/2012 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

post ur sql script
i will resolve ur problem

Dhirajkumar
Posted by: Dhirajkumar | Posted on: 1/18/2013 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

For using group by clause we have to use aggregate function.

Dhiru

>> Write Response - Respond to this post and get points

More Coding Horrors

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 6:18:33 PM