Hello everyone,
I have a table called job.In the table two particular columns are empid and managerid.When I am creating the table I must ensure that the managerid should be an existing empid.How do I write the create table statement for this.I am using oracle 10g.
Thank you
ripplex
0
Newbie Poster
Recommended Answers
Jump to Posttry this
CREATE TABLE JOB (EMP_ID NUMBER PRIMARY KEY, MGR_ID NUMBER, CONSTRAINT EMP_CONST1 FOREIGN KEY (MGR_ID) REFERENCES JOB (EMP_ID) )
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.