Hi all,

I'm using the nodes/tree methodology to create a grouped set of data:

        Home
          Page 1
          Page 2
        Section 1
          More stuff
          A bit more stuff
        Section 2
          Another group of stuff

Problem is, I figure out how to alphabetize, but preserve the grouping. That
is, sort top-level nodes alphabetically, and then sort their subnodes, while
preserving the tree structure.

Here's the query:

<cfquery name="caller.getallnodes" datasource="#request.datasource#">
        SELECT child.nodeid, child.nodename, COUNT(child.startbranch) AS lvl,
        Child.startbranch, Child.endbranch
        FROM nodes_tree AS Parent, nodes_tree AS Child
        WHERE Child.startbranch
        BETWEEN parent.startbranch AND Parent.endbranch
                <cfif isdefined("getbranch.recordcount") AND getbranch.recordcount GT 
0>
                        AND child.startbranch >= <cfqueryparam 
cfsqltype="CF_SQL_INTEGER"
value="#getbranch.startbranch#">
                        AND child.endbranch <= <cfqueryparam cfsqltype="CF_SQL_INTEGER"
value="#getbranch.endbranch#">
                </cfif>
        GROUP BY Child.startbranch, Child.nodeid, Child.nodename, Child.endbranch
</cfquery>

Any help would be great,

Thanks,

Ian

Portent Interactive
Helping clients build customer relationships on the web since 1995
Consulting, design, development, measurement
http://www.portentinteractive.com
Talk with us: http://projects.portentinteractive.com

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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