Discussions

HI EXPERT

select TABLE_NAME, column_name,data_type from user_tab_cols;

select TABLE_NAME, column_name,data_type from RND_TABLES;

create table rnd_tables(TABLE_NAME varchar2(30),column_name varchar2(30));

insert into rnd_tables values('EMPLOYEES','id');

insert into rnd_tables values('EMPLOYEES','FNAME');

insert into rnd_tables values('EMPLOYEES','LNAME');

insert into rnd_tables values('EMPLOYEES','DOB');

insert into rnd_tables values('EMPLOYEES','email');

insert into rnd_tables values('EMPLOYEES','phone');

insert into rnd_tables values('EMPLOYEES','location');

insert into rnd_tables values('DEPT','DeptID');

insert into rnd_tables values('DEPT','DNAME');

insert into rnd_tables values('DEPT','DEPTCODE');

select * from user_tab_cols;

create table current_schema(TABLE_NAME varchar2(30),column_name varchar2(30));

insert into current_schema values('EMPLOYEES','id');

insert into current_schema values('EMPLOYEES','FNAME');

insert into current_schema values('EMPLOYEES','LNAME');

insert into current_schema values('EMPLOYEES','doj');

insert into current_schema values('EMPLOYEES','DOB');

insert into rcurrent_schema values('DEPT','DEPTCODE');

insert into current_schema values('DEPT','JOB_ID');

IN RND_TABLES IS SCHEMA ONLY PARTICULAR COLUMN HAS BEEN TAKEN IN CURRENT SCHEMA.

THE QUESTION IS I WANT ONLY OMITTED COLUMNS IN RND_SCHEMA.

ANYONE PLEASE SEND THE QUERY TO TAKE THIS:

OUTPUT SHOULD BE

TABLE_NAME   RND_COLUMN_NAME CURRENT_SCHEMA

EMPLOYEES     phone            -

EMPLOYEES     LOCATION         -

EMPLOYEES      -               doj

dep           DeptID           -

dep           DNAME           -

dep           DeptID           JOB_ID

Sign In or Register to comment.