I don't know what DB you're using, but have you tried using 'group by'? Something like this: select fname, lname, address, city, state, zip from contacts group by state, city, zip
> -----Original Message----- > From: Les Mizzell [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 11, 2006 1:00 PM > To: CF-Talk > Subject: Group - but with no order specified > > Is there a way to group output in a query and keep the groups > together, > but with no order specified anywhere? > > <cfquery> > Select myGROUP, mySubGROUP from myTABLE > <!---(NO ORDER BY)---> > </cfquery > > I need output like: > > 1. myGROUP > a. mySUBGOUP 1 > b. mySUBGOUP 2 > > 2. myGROUP 2 > a. mySUBGOUP 1 > b. mySUBGOUP 2 > > If you just do the below, it doesn't keep the groups together since > they're not together in the database... > > <cfoutput group="myGROUP"> > 1. myGROUP > a. mySUBGOUP 1 > b. mySUBGOUP 2 > </cfoutput> > > Outputs (depending on what's in the database) > > 1. myGROUP > a. mySUBGOUP 1 > > 2. myGROUP 2 > a. mySUBGOUP 1 > b. mySUBGOUP 2 > > 1. myGROUP > b. mySUBGOUP 2 > > > If I add a ORDER to the query, it obviously works - but, the client > doesn't WANT them in any order. He just wants the groups together. > > I say you can't have it both ways. You have to have a sort > order to keep > the groups together. Or is there a weird work around for this? > > > Yea - stupid I know, but clients want what they want... > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237457 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54