List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:October 19 2004 11:24am
Subject:Re: Ask for help on a mysql problem
View as plain text  
Teng Wang <eruisi@stripped> wrote:

It's really clear what you want. Please specify. 

If what you basicaly want is just a tree structure, then it's done like that: 


CREATE TABLE something ( 
	id INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
	parent INT NOT NULL,
	data1 CHAR(255),
	data2 CHAR(255),
	...

);

Then you can specify the parent node id for each record in database. 
This is how tree-like structures are stored in SQL. Hope that helps.

> I wanna setup a tree structure. Each node in this tree is a
> table. Each table has a "link" field. For each record, the
> data in this field is a pointer to another table or null.
> 
> I read mysql manual but don't find any clues that SQL
> supports such a "link" field. Does anyone has an idea about
> that?
> 
> Thanks a lot!
> 
> 
> 
>                            eruisi
>                            10/14/2004
>                            23:26:58
> 
> 





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
Ask for help on a mysql problemTeng Wang15 Oct
  • Re: Ask for help on a mysql problemDiona Kidd15 Oct
  • Re: Ask for help on a mysql problemEgor Egorov19 Oct
  • Re: Ask for help on a mysql problemMartijn Tonies19 Oct
  • Re: Ask for help on a mysql problemHarald Fuchs19 Oct
  • Re: Ask for help on a mysql problemMartijn Tonies19 Oct
Re: Ask for help on a mysql problemMartijn Tonies19 Oct