Re: How to find the top most member in a hierarchy of subcategories

2006-09-13 Thread Jo�o C�ndido de Souza Neto
I found something that we can get all the tree. SELECT cat_id, group_concat( id ) FROM categoria GROUP BY cat_id Try it and tell me if it´s good or not. ""abhishek jain"" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > Hi, > I have a table structure like : > ID , NAME, PARENT

Re: How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread Renato Golin
Peter Lauri wrote: Yes, and this shows that you can not do it will MySQL purely :) But a scripting language like php can do it for you with a recursive function as the best option. IMHO, the best option would do it with a procedure as you don't get out of the database and don't have any overhe

RE: How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread Peter Lauri
PM To: mysql@lists.mysql.com Subject: Re: How to find the top most member in a hierarchy of subcategories I´m not quite sure if it could help you, because it´s whole in portuguese, but i´ll send you. My table is called categoria and has the follow structure: CREATE TABLE `categoria` ( `id

RE: How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread Peter Lauri
Sent: Monday, September 04, 2006 4:29 PM To: mysql@lists.mysql.com Subject: How to find the top most member in a hierarchy of subcategories Hi, I have a table structure like : ID , NAME, PARENT_ID 1 , Top , 0 2 , Level 1 , 1 3 , Level 2 ,2 4 , Another Top , 0 and so on. I wanted to know the

Re: How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread Jo�o C�ndido de Souza Neto
I´m not quite sure if it could help you, because it´s whole in portuguese, but i´ll send you. My table is called categoria and has the follow structure: CREATE TABLE `categoria` ( `id` int(20) NOT NULL auto_increment, `cat_id` int(20) NOT NULL default '0', `nome` varchar(50) NOT

How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread abhishek jain
Hi, I have a table structure like : ID , NAME, PARENT_ID 1 , Top , 0 2 , Level 1 , 1 3 , Level 2 ,2 4 , Another Top , 0 and so on. I wanted to know the topmost cat. if i have the lowest category id ie. 3 in this case. I wanted to get like 3->2->1 Pl. help me , cn i do this in one query, also i d