CREATE TABLE USER_info ( U_ID VARCHAR2(40 BYTE) NOT NULL, Fname VARCHAR2(40 BYTE), LNAME VARCHAR2(40 BYTE) , CONSTRAINT USER_info_PK PRIMARY KEY (U_ID) ) / CREATE TABLE e_map (e_map_ID VARCHAR2(20 BYTE) NOT NULL, hold_ID VARCHAR2(20 BYTE) , U_ID VARCHAR2(20 BYTE) , GID VARCHAR2(20 BYTE), SID NUMBER(10, 0) NOT NULL , CONSTRAINT e_map_PK PRIMARY KEY (e_map_ID) ) / ALTER TABLE e_map ADD CONSTRAINT e_MAP_FK1 FOREIGN KEY (U_ID) REFERENCES USER_info (U_ID) / -- --INFO Table -- CREATE TABLE e_INFO (U_ID VARCHAR2(20 BYTE) NOT NULL, info VARCHAR2(200 BYTE) ,CONSTRAINT e_INFO_PK PRIMARY KEY (U_ID) ) / ALTER TABLE e_INFO ADD CONSTRAINT e_info_fk1 FOREIGN KEY (U_ID) REFERENCES USER_info (U_ID) / -- --HOLD_map Table -- CREATE TABLE HOLD_map ( HOLD_map_ID VARCHAR2(20 BYTE) NOT NULL, CID VARCHAR2(20 BYTE) NOT NULL, hold_ID VARCHAR2(20 BYTE) NOT NULL, SID NUMBER NOT NULL , CONSTRAINT HOLD_map_PK PRIMARY KEY (HOLD_map_ID) ) / -- -- Insert Script -- INSERT INTO USER_INFO (U_ID, Fname, Lname) values('1', 'peter', 'shaw'); INSERT INTO USER_INFO (U_ID, Fname, Lname) values('2', 'peter2', 'shaw2'); INSERT INTO USER_INFO (U_ID, Fname, Lname) values('3', 'peter3', 'shaw3'); INSERT INTO USER_INFO (U_ID, Fname, Lname) values('4', 'peter4', 'shaw4'); INSERT INTO USER_INFO (U_ID, Fname, Lname) values('5', 'peter5', 'shaw5'); / INSERT INTO e_map (e_map_ID, hold_id, u_id, GID, SID) values('emap1', 'hold1', '1', 'gid1', 1); INSERT INTO e_map (e_map_ID, hold_id, u_id, GID, SID) values('emap2', 'hold2', '1', 'gid1', 2); INSERT INTO e_map (e_map_ID, hold_id, u_id, GID, SID) values('emap3', 'hold1', '1', 'gid1', 3); INSERT INTO e_map (e_map_ID, hold_id, u_id, GID, SID) values('emap4', 'hold1', '1', 'gid1', 4); INSERT INTO e_map (e_map_ID, hold_id, u_id, GID, SID) values('emap5', 'hold1', '1', 'gid1', 5); / INSERT INTO e_info (u_id, info) values('1', 'abc'); INSERT INTO e_info (u_id, info) values('2', 'abcd'); INSERT INTO e_info (u_id, info) values('3', 'abcde'); INSERT INTO e_info (u_id, info) values('4', 'abcdef'); INSERT INTO e_info (u_id, info) values('5', 'abcdefg'); / INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map1', 'hold1', 'cid1', 1); INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map2', 'hold1', 'cid2', 2); INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map3', 'hold2', 'cid3', 2); INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map4', 'hold3', 'cid4', 3); INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map5', 'hold1', 'cid5', 1); INSERT INTO hold_map (hold_map_ID, hold_id, cid,SID) values('hold_map6', 'hold1', 'cid6', 1); -- -- Query with output data -- SELECT distinct d.U_ID, a.GID, b.info, b.u_id E_UID, c.cid, c.sid, a.u_id Emap_UID, d.fname, d.lname FROM ptest.e_map a, ptest.e_info b, ptest.hold_map c, ptest.user_info d WHERE a.u_id = b.u_id AND a.hold_id = c.hold_id AND a.u_id = d.U_ID OUTPUT ====== "U_ID" "GID" "INFO" "E_UID" "CID" "SID" "EMAP_ID" "FNAME" "LNAME" "1" "gid1" "abc" "1" "cid1" "1" "1" "peter" "shaw" "1" "gid1" "abc" "1" "cid2" "2" "1" "peter" "shaw" "1" "gid1" "abc" "1" "cid3" "2" "1" "peter" "shaw" "1" "gid1" "abc" "1" "cid5" "1" "1" "peter" "shaw" "1" "gid1" "abc" "1" "cid6" "1" "1" "peter" "shaw" Now I Wants reuslts like - For All same U_ID, i wants cid1, cid2, cid3 and whatever as a column header "U_ID" "GID" "INFO" "E_UID" "cid1" "cid2" "cid3" "cid5" "cid6" "SID" "EMAP_UID" "FNAME" "LNAME" "1" "gid1" "abc" "1" "cid1" "cid2" "cid3" "cid5" "cid6" "1" "1" "peter" "shaw"