Cukup gunakan sintaks berikut dalam pernyataan pilih Anda:
INSERT INTO axis.axis_data
(projinfo_table_id, rate_user, name,
property_owner, property_address, property_city,
property_state, property_zip, property_phone,
rating_date, rating_type, rating_reason, rating_number,
field1, field2
)
SELECT NEW.id, user(), NEW.BLGNAME,
NEW.POWNER, NEW.STREET, NEW.CITY,
NEW.STATE, NEW.ZIP, NEW.PHONE,
NEW.RATDATE, NEW.RATTYPE, NEW.RATREAS, NEW.RATNGNO,
c.field1, c.field2
FROM COMP c WHERE c.id = NEW.id
Jika COMP tidak selalu memiliki record yang sesuai di PROJ, Anda dapat menggunakan SELECT ... FROM DUAL LEFT JOIN COMP c ON c.id = NEW.id