If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Whats the syntax for updating a table when using an inner join? I know how to use an INNER JOIN in a SELECT statement, and an UPDATE statement, but cant figure out how to put them together!
Eg, i want to update the transactions table with the customer id from the customers table by joining the transaction_id from both tables?
i will be using it in both MSSQL and MYSQL, i was just after the basic syntax which you've given me of using an update with a join, didn't think about doing it the way you suggested (the simple way!)
This might be redundant as I know the overall goal of what you are attempting here but.... these two tables are not both part of your finalised, normalised database are they?
No, the two tables i gave were just an example i made up. They are similiar however to the tables i'm trying to change, but i only had one of the duplicate columns in each table to match one to the other, i will be deleting one of the columns once i have matched them together to make a one-to-many relationship - i realise you may think it was an odd example to to give as it had the same columns in each table.