<cfquery name="qTest" datasource="#request.DSN#">
SELECT location, ball
FROM table
ORDER BY location, ball
</cfquery>
<cfoutput query="qTest" group="location">
<h2>#qTest.location#</h2>
        <cfoutput>
        #qTest.ball#<br>
        </cfoutput>
        <br>
</cfoutput>

-----Original Message-----
From: JLH All Turbo [mailto:[EMAIL PROTECTED]] 
Sent: vrijdag 9 augustus 2002 15:36
To: CF-Talk
Subject: SQL Help


How can I structure a query and it's output to pull all the records out
that have a certain field = something and have them grouped by another
field...

And then in the output put a header for each group?

In a DB with baseballs and footballs and different locations for the
balls.

Pull all balls out and group by locations

So the output would be something along the lines of

LOCATION1NAME
baseball1
baseball2
football1
football2

LOCATION2NAME
baseball3
baseball4
football3
football4

etc and run through all the locations and all the balls that pertain to
those locations.  I can get the query down, just outputting the
<cfoutput> to change the header of the tables is where I'm running in to
problems.

Maybe you guys can help?

J



______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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

Reply via email to