Reputation: 412
I have a table that has 5,000(table1) lines in it. Currently, 3,000 of them are filled up with data. The remaining values are currently null. In a separate table(table2), I have the remaining 2,000 rows of data. I am simply trying to take the values in table2 and put them in table1, but this statement isn't working:
Update table1
Set field1 = (Select field1
From table2
Where table1.id = table2.id)
Where Exists(Select field1
From table2
Where table1.id = table2.id)
It looks like this should be working, but I am getting an error from Base, the db program I am using that just says error Near " ": syntax error...any help?? Thanks!
Upvotes: 2
Views: 372
Reputation:
You could try doing it with a join. I'm used to doing it in T-SQL but I believe the syntax will be the same or pretty similar.
Update Table1
JOIN Table2 ON Table1.id = Table2.id
SET Table1.value = Table2.value
Upvotes: 2