Hi.
I'm very new to Oracle (and databases in general), and I have a problem
that most of you people probably will find very easy, but I just can't
figure it out...
I'm trying to create a "recursive" query(?) in Oracle that finds all
PublisherPerson s outranking my PublisherPerson in a direct line from his
immediate supervisor and all the way up to the CEO.
(Given that all persons except the CEO have a supervisor of sorts)
CREATE TABLE PublisherPerson
(
ppersonID VARCHAR2(5) NOT NULL, <-----
ppersonname VARCHAR2(30) NOT NULL, |
publisherID VARCHAR2(5) NOT NULL, |
deptID VARCHAR2(5), |
supervisorID VARCHAR2(5), ---------------
PRIMARY KEY (ppersonID),
FOREIGN KEY (publisherID) REFERENCES Publisher,
FOREIGN KEY (deptID) REFERENCES Dept
);
I really have no clue as to how I can achieve this, and I'd really
appreciate any help you can give me!
Paul
I'm very new to Oracle (and databases in general), and I have a problem
that most of you people probably will find very easy, but I just can't
figure it out...
I'm trying to create a "recursive" query(?) in Oracle that finds all
PublisherPerson s outranking my PublisherPerson in a direct line from his
immediate supervisor and all the way up to the CEO.
(Given that all persons except the CEO have a supervisor of sorts)
CREATE TABLE PublisherPerson
(
ppersonID VARCHAR2(5) NOT NULL, <-----
ppersonname VARCHAR2(30) NOT NULL, |
publisherID VARCHAR2(5) NOT NULL, |
deptID VARCHAR2(5), |
supervisorID VARCHAR2(5), ---------------
PRIMARY KEY (ppersonID),
FOREIGN KEY (publisherID) REFERENCES Publisher,
FOREIGN KEY (deptID) REFERENCES Dept
);
I really have no clue as to how I can achieve this, and I'd really
appreciate any help you can give me!
Paul
Comment