I'd use a union SQL statement to join two queries (parent and children)
together, with an ORDER BY on a dummy column to make sure the parent message
comes out first. Unless you also want all parent's descendents (i.e. the
children's children, etc), in which case you're stuck unless you DB server
supports something like Oracle's START WITH...CONNECT BY statement (which is
very confusing anyway).

-- 
Paul Wakefield

All opinions expressed herein are those of the author and not of The Board
of Executors

> ----- Original Message -----
> From: "Chris Evans" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 18, 2000 8:30 PM
> Subject: Parent/Child query
> 
> 
> > I have two tables.  One contains messages, with MessageID 
> as a primary key
> > and a bunch of other columns.  I have a second table that 
> has a Parent
> > column, and a MessageID column.  I am trying to grab the 
> messages, and use
> > the Parent and MessageID table to build the parent child 
> relationships. I
> > want the query to return with parent message followed by children
> messages.
> > I can't get it to work correctly, though.
> >
> > Any ideas?
> >
> > Chris Evans
> > [EMAIL PROTECTED]
> > http://www.fuseware.com
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to