Doug,

In this situation you need to nest your <cfoutput> tags and use the group
parameter.

<cfquery name="qCatsSubs" datasource="xxx">
        SELECT categories.cat_id,
                 categories.category,
                 sub_categories.sub_id,
                 sub_categories.sub_category
        FROM  categories INNER JOIN sub_categories
                ON cat_id = sub_cat_id
</cfquery>

<cfoutput query="qCatsSubs" group="cat_id">
        <h1>#category#</h1>
        <cfoutput>
        #sub_category#<br>
        </cfoutput>
</cfoutput>

-----Original Message-----
From: Doug [mailto:[EMAIL PROTECTED]
Sent: 06 August 2006 16:15
To: CF-Talk
Subject: ok here we go again


I am very sorry to keep bothering the list with my inexperience or
forgetfullness.

I now have my tables populated thanks to your help.


[categories]
cat_id PK
category

[sub_categories]
sub_id
sub_cat_id FK to cat_id
sub_category

I am trying to work my query so that it will come out with the each category
listed only once and the associated sub_categories beneath them. I keep
getting multiple listings of the same stuff over and over again. Someone
said I would need another table, do I ?




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

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

Reply via email to