Re: Recursive queries

2007-07-09 Thread David T. Ashley
On 7/8/07, Steffan A. Cline <[EMAIL PROTECTED]> wrote: I am trying to set up a forum where there are main posts with replies and replies to replies. Rather than using nested queries in my middleware I am thinking there has to be some kind of recursive query where I can output the results in a fo

Re: Recursive queries

2007-07-09 Thread Baron Schwartz
Hi, Steffan A. Cline wrote: I am trying to set up a forum where there are main posts with replies and replies to replies. Rather than using nested queries in my middleware I am thinking there has to be some kind of recursive query where I can output the results in a format like so: MAIN Rep

Re: recursive queries

2005-12-09 Thread Eric Bergen
I believe that some time in the future mysql will support oracle style connect by prior syntax but it's not implemented yet. Gleb Paharenko wrote: Hello. Though I haven't read this article, but its title looks promicing: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Re: recursive queries

2005-12-09 Thread Gleb Paharenko
Hello. Though I haven't read this article, but its title looks promicing: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Duncan Miller wrote: > I am looking to do a query on a self join table that returns the parent > records. > > Obviously there are ways to d

Re: recursive queries

2005-12-08 Thread Duncan Miller
I am looking to do a query on a self join table that returns the parent records. Obviously there are ways to do this, but just wondered if there are any functions in MySQL that make this easier, or specific functions available to stored procedures. I have read the manual and couldn't find any

Re: recursive queries

2005-12-08 Thread SGreen
Duncan Miller <[EMAIL PROTECTED]> wrote on 12/08/2005 06:40:55 AM: > Is there any built in or other support for recursive queries . I > suspect not, but wonder what is considered the best approach. > > With stored procedures being supported in 5.0 is that the way to handle these. > > Thanks >

Re: Recursive queries

2005-05-13 Thread John Doe
Am Freitag, 13. Mai 2005 10.32 schrieb Marcus Bointon: > I have a table that represents a tree structure via a self-join. I'd > like to get hold of all parent records in a single query - is such a > thing possible? e.g. given > > idparentid > 10 > 21 > 32 > 42 > 51 > 64

Re: Recursive queries

2005-05-13 Thread Marcus Bointon
On 13 May 2005, at 10:02, [EMAIL PROTECTED] wrote: if you use php, you can look at http://www.sitepoint.com/article/hierarchical-data-database That's just what i needed, great article. Thanks, Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] | http://www.s

Re: Recursive queries

2005-05-13 Thread mfatene
Hi, in oracle we have connect by prior for hierachical data traversal. in mysql, you can use group_concat like this : mysql> select parentid, group_concat(id) from ids -> group by parentid; +--+--+ | parentid | group_concat(id) | +--+--+ |

Re: Recursive queries

2001-03-05 Thread Bob Hall
>Quick searches of Google and the MySQL page didn't turn up anything, >so I'll ask here.. > >Here's what I have: >I have a table that among others, have fields called 'section_id' >and 'parent_id'. The section_id is the id of the "self" section, and >the parent_id is the id of the section that

Re: Recursive queries

2001-03-05 Thread Isaac Force
On Mon, 5 Mar 2001 21:50:42 + Pierre-Alain Joye <[EMAIL PROTECTED]> wrote: > > create table root( > > create table subcats( > > create table subsections( > > And now I need 230 levels, huh :). > > How about a simple tree structure ? If our thinking of a tree structure is the same, I believ

Re: Recursive queries

2001-03-05 Thread Isaac Force
On Mon, 5 Mar 2001 10:13:29 -0600 "Johnny Withers" <[EMAIL PROTECTED]> wrote: > Well, if you have everything setup right.. this is easy to do in SQL. > > Lets say you have your root table: [...] > > and your sub categories: [...] > > and your final category: [...] > > now you can simply

Re: Recursive queries

2001-03-05 Thread Pierre-Alain Joye
> create table root( > create table subcats( > create table subsections( And now I need 230 levels, huh :). How about a simple tree structure ? hth pa - Before posting, please check: http://www.mysql.com/manual.php (the

RE: Recursive queries

2001-03-05 Thread Johnny Withers
Well, if you have everything setup right.. this is easy to do in SQL. Lets say you have your root table: create table root( id integer unsigned not null auto_increment, description varchar(50), key root_key (id) ); and your sub categories: create table subcats(