RE: Group by problem in select query
> Is there a way around this error message? I am selecting 8 > fields (one is a count) and I do not want a group by clause. > Without a group by clause or if I leave one of the fields out of > the group by clause, I receive this error message: > > Column 'location_city' is invalid in the select list because it > is not contained in an aggregate function and there is no GROUP BY clause. By asking for a COUNT(), then it's an aggrigate query - this means that you have to call either the other columns with aggrigate functions or in the GROUP BY Without calling them with this, it's rather like saying "I want to fly to Europe, but don't want to go in an aeroplane" Philip Arnold ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Group by problem in select query
By their very nature aggregate functions require a group by. If you have no group by, then the entire recordset is the group and location_city would make no sense unless your entire recordset has the same value for location_city - Original Message - From: "Kathy Bergman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 23, 2000 9:19 AM Subject: Group by problem in select query Is there a way around this error message? I am selecting 8 fields (one is a count) and I do not want a group by clause. Without a group by clause or if I leave one of the fields out of the group by clause, I receive this error message: Column 'location_city' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Group by problem in select query
> I am selecting 8 fields (one is a count) and I do not want a group by clause. Kathy, You have to have a GROUP BY if you are using COUNT(). It's an aggregate function - that means it's meaningless without a GROUP BY. What are you trying to do? Nick ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Group by problem in select query
Is there a way around this error message? I am selecting 8 fields (one is a count) and I do not want a group by clause. Without a group by clause or if I leave one of the fields out of the group by clause, I receive this error message: Column 'location_city' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.