CF doesn't care if the records are actually in order, it just processes
the outer loop when there's a change of value.

If myGROUP has a numeric primary key you could do your ORDER BY on that,
rather than on the name of it.

Failing that, you could sort in some strange way that might look random,
but isn't. Like on the 2nd through 5th character in the name.

Failing THAT, I'd suggest creating a SORT_ORDER (INTEGER) column for
each of the myGROUP records and ask your client what order he'd like
them in.



-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 11, 2006 3: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:237458
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to