> You don't need the groupby in the cfoutput
> You need it in the cfquery, as long as that is what
> your data is going to look like.
>
> <cfquery name="foo" datasource="#application.dsn#">
> SELECT prod_type_id, id, show, price, name
> FROM prod
> GROUP BY prod_type_id, id, show, price, name
> </cfquery>
There's no need to use GROUP BY unless you're selecting aggregate values in
addition to selecting columns. For example, if you wanted to know how many
products per type, you might write your query like this:
<cfquery name="foo" datasource="#application.dsn#">
SELECT COUNT(prod_type_id) AS HowManyProducts,
id, show, price, name
FROM prod
GROUP BY id, show, price, name
</cfquery>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists