When you instruct the system to only return one of a group like that, 
you have to tell it which of the possible selections to make.  So, you 
need to either group by the other columns (which will return a row for 
every distinct entry in that column) or use an aggregate function to 
only return one.  You could return the min or max or similar of the 
other columns, which may solve your problem.

--Ben

Mike | NZSolutions Ltd wrote:
> Hi guys,
> 
> Got a product query (see below) - just want to make sure that not more
> than one of each product_id is displayed on a page. Tried the GROUP BY
> function
> 
> Eg. GROUP BY products.product_id
> 
> But I get the error...
> 
> [Macromedia][SQLServer JDBC Driver][SQLServer]Column
> 'products.product_price' is invalid in the select list because it is not
> contained in either an aggregate function or the GROUP BY clause.
> 
> This error occurs for all columns not included in the group by. How can
> I achieve this?
> 
> Thanks
> mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:269476
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to