This is a discussion on Koreign Key within the MySQL forums, part of the Database Server Software category; --> hi I can make an tree using reference (foreing) key on self table? example command SQL: create table a ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hi I can make an tree using reference (foreing) key on self table? example command SQL: create table a ( ID INT not null auto_increment, n varchar(100), x int, primary key ID, Constraint n forign_key (x) references a(ID) on delete cascade on update cascade ) egine InnoDB. This Instraction can be running on mysql 5.0 thank's gabry webmaster di www.fantogame.it buongiorno Io posso creare un albero usando reference (foreing) key sulla stessa tabella: instruzione SQL: create table a ( ID INT not null auto_increment, x varchar(100), x int, primary key ID, Constraint n forign_key (x) references a(x) on delete cascade on update cascade ) egine InnoDB. puņ funzionare su mysql 5.0 ocrea qualche intoppo. grazie gabry webmaster di www.fantogame.it |
| |||
| On Aug 4, 4:50 pm, gabryfan <gabriele.fant...@fantogame.it> wrote: > hi > > I can make an tree using reference (foreing) key on self table? > > example > > command SQL: > create table a ( > ID INT not null auto_increment, > n varchar(100), > x int, > primary key ID, > Constraint n forign_key (x) references a(ID) on delete cascade on update > cascade > ) > egine InnoDB. > > This Instraction can be running on mysql 5.0 > > thank's > gabry > > webmaster diwww.fantogame.it > > buongiorno > > Io posso creare un albero usando reference (foreing) key sulla stessa > tabella: > > instruzione SQL: > > create table a ( > ID INT not null auto_increment, > x varchar(100), > x int, > primary key ID, > Constraint n forign_key (x) references a(x) on delete cascade on update > cascade > ) > > egine InnoDB. > > puņ funzionare su mysql 5.0 ocrea qualche intoppo. > > grazie gabry > > webmaster diwww.fantogame.it Did you try creating that table to see what would happen? You've already written the SQL so it shouldn't be too much of a stretch to run it. |
| |||
| ZeldorBlat ha scritto: > On Aug 4, 4:50 pm, gabryfan <gabriele.fant...@fantogame.it> wrote: >> hi >> >> I can make an tree using reference (foreing) key on self table? >> >> example >> >> command SQL: >> create table a ( >> ID INT not null auto_increment, >> n varchar(100), >> x int, >> primary key ID, >> Constraint n forign_key (x) references a(ID) on delete cascade on update >> cascade >> ) >> egine InnoDB. >> >> This Instraction can be running on mysql 5.0 >> >> thank's >> gabry >> >> webmaster diwww.fantogame.it >> >> buongiorno >> >> Io posso creare un albero usando reference (foreing) key sulla stessa >> tabella: >> >> instruzione SQL: >> >> create table a ( >> ID INT not null auto_increment, >> x varchar(100), >> x int, >> primary key ID, >> Constraint n forign_key (x) references a(x) on delete cascade on update >> cascade >> ) >> >> egine InnoDB. >> >> puņ funzionare su mysql 5.0 ocrea qualche intoppo. >> >> grazie gabry >> >> webmaster diwww.fantogame.it > > Did you try creating that table to see what would happen? You've > already written the SQL so it shouldn't be too much of a stretch to > run it. > How I Must Written the SQL instruction? thank's |
| ||||
| On Aug 4, 4:59 pm, gabryfan <gabriele.fant...@fantogame.it> wrote: > ZeldorBlat ha scritto: > > > > > On Aug 4, 4:50 pm, gabryfan <gabriele.fant...@fantogame.it> wrote: > >> hi > > >> I can make an tree using reference (foreing) key on self table? > > >> example > > >> command SQL: > >> create table a ( > >> ID INT not null auto_increment, > >> n varchar(100), > >> x int, > >> primary key ID, > >> Constraint n forign_key (x) references a(ID) on delete cascade on update > >> cascade > >> ) > >> egine InnoDB. > > >> This Instraction can be running on mysql 5.0 > > >> thank's > >> gabry > > >> webmaster diwww.fantogame.it > > >> buongiorno > > >> Io posso creare un albero usando reference (foreing) key sulla stessa > >> tabella: > > >> instruzione SQL: > > >> create table a ( > >> ID INT not null auto_increment, > >> x varchar(100), > >> x int, > >> primary key ID, > >> Constraint n forign_key (x) references a(x) on delete cascade on update > >> cascade > >> ) > > >> egine InnoDB. > > >> puņ funzionare su mysql 5.0 ocrea qualche intoppo. > > >> grazie gabry > > >> webmaster diwww.fantogame.it > > > Did you try creating that table to see what would happen? You've > > already written the SQL so it shouldn't be too much of a stretch to > > run it. > > How I Must Written the SQL instruction? > thank's create table a ( ID INT not null auto_increment, n varchar(100), x int, primary key ID, Constraint n forign_key (x) references a(ID) on delete cascade on update cascade ) egine InnoDB |