So lets say I have TABLE1 and TABLE2.
CREATE TABLE TABLE1
(
first_id int NOT NULL,
first_random_attribute varchar(255)
primary key(first_id)
)
CREATE TABLE TABLE2
(
second_id int NOT NULL,
second_random_attribute varchar(255)
primary key(second_id)
)
How would a compare TABLE1 and TABLE2 with one another, create a relational table, check if their x_random_attribute’s are equivalent and if they are, store the primary keys of each one in the new relational table?
Portable SQL
Specific alternatives:
CREATE TABLE AS SELECT ...in one statementSELECT .. INTO ...