If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > owner-relationship innodb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-04, 14:32
dirceu dirceu is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
self-relationship innodb

Sorry, my english is so bad! So, I can`t do that on innodb:

create table user (
id_user tinyint(3) not null auto_increment,
name char(30),
primary key (id_user)
index (id_user)
);

create table subordinated (
id_manager tinyint(3) not null,
id_sub tinyint(3) not null,
primary key (id_manager, id_sub),
index (id_manager, id_sub),
foreign key (id_manager, id_sub)
references user (id_user, id_user) ????????
on update cascade on delete restrict
);

thanks,

Dirceu - Brazil

Last edited by dirceu; 03-22-04 at 14:40.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On