I am working in ORACLE DB for one of my projects. Now i have to insert the values to one table from 2 different tables.
Table created a below:
CREATE TABLE ATRB_VALUES_COUNT(MID VARCHAR(20),GID VARCHAR(20),SID VARCHAR(20),AID VARCHAR(20),AVID VARCHAR(20))
you should use join not union
insert into ATRB_VALUES_COUNT(MID,GID,SID,AID,AVID) select a.AID,a.AVID, b.SID,c.MID,c.GID from ATRB_VAL as a, ATRB as b, SB_ATRB as c
(your join here, join 3 tables` ATRB_VAL , ATRB, SB_ATRB )