I am using inner join. But I think I am doing it wrong.. Want multiple tables to match but I am not sure how to use my where. Any pointers or suggestions would greatly be appreciated. example UPDATE table1 t1 INNER JOIN table2 t2 ON t1.id =t2.num WHERE INNER JOIN table3 t3 ON SUBSTRING_INDEX(t1.id,'-',1) = t3.buy_id WHERE INNER JOIN table3 ON t2.name = table3.MOD SET t1.id=t2.id
Updates are for sending data back to the database. I don't know if you can do it with multiple tables but I wouldn't. Are you trying to get data from the database? I'd be really worried about any table structure that stored id numbers in columns called "num", "name" or "mod"
why would you be worried about tables called called "num", "name" or "mod" ? Just wondering? If you saw some of the stuff was done. man on man..
Id columns are normally called that and if they refer to a foreign table the column name should refer to the table and include id. I'm sure there's some really bad design out there, doesn't mean it should be though.
Thank you. Yes its been something of a challenge but at least im making some progress.. So what I did was added a few comlumns to the table. However I am not querying it right. How would I query something like this? update table1 column1=columna where column2=column3 thanks
i figured this last part out. update table1 h JOIN table1 x on x.column1=h.column2 SET h.column=x.column5