My first table(t1) is a simple list of websites.
url
My second table(t2) has two columns
url, source
I would like to do something like this
insert into t2(url, source) where ((select * from t1), '1');
But I am getting an error that I have to many rows from my select * from t1. I understand why I am getting the error, but how should I do this query instead?
The reason why I am not editing t1 is that I have many different "t1"s that I would like to mark in my new master table as different with the sourceIDs.
If you want to copy the values of the url column from table t1 into the url column of table t2 and at the same time fill the source column with the value '1' then you can do it like this
INSERT INTO t2(url, source) SELECT url, '1' FROM t1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With