This content has been marked as final. Show 4 replies
Please next time post sample data.
Please read SQL and PL/SQL FAQ
If table structures are the same you can do as follow:
INSERT INTO table_a a SELECT * FROM table_b MINUS SELECT * from table_a;
942919 wrote:Not sure why you despise constraints; But below could be a way (IMAGINARY & Un-Tested) since you chose not to provide us with Sample Tables and Data
I have table A contains 5 colums and doent contain any constraints and 1000 records are avaible
I have table B contains 5 columns contain 500 records
and table A and table B have same data types of columns
now i want to insert table B rows to table A . If table A contain same rows of table B, should not insert table B rows.
Please give me solution for with out using any contraints.
Edited by: Purvesh K on Nov 23, 2012 4:20 PM
INSERT INTO table_a select col1, col2... coln from table_b b where not exists ( select 'x' from tabel_a a where a.matching_col = b.matching_col ) -- Your Matching Cols may increase, so adapt accordingly.