Results 1 to 1 of 1
  1. #1
    Join Date
    Mar 2004

    Unanswered: 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


    Dirceu - Brazil
    Last edited by dirceu; 03-22-04 at 15:40.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts