karimali831 Posted April 23, 2010 Share Posted April 23, 2010 Hi, I have two tables, (table1 & and table2) table 1 columns -> ID, 1on1 table 2 columns -> ID, 1on1 I want to use an SQL UPDATE query for table2 so that the rows in table 1 for the 1on1 column is the same in table 2 for the same 1on1 column. Rows in table 1 is how I want it in table 2 for the 1on1 column, ID in table 1 is the same ID in table 2 so I was thinking that I must use WHERE ID clause for the UPDATE query? Current rows for 1on1 column is 0 for table2. Thanks for help if you can. Quote Link to comment https://forums.phpfreaks.com/topic/199474-sql-update-query/ Share on other sites More sharing options...
karimali831 Posted April 23, 2010 Author Share Posted April 23, 2010 is this query not possible? Quote Link to comment https://forums.phpfreaks.com/topic/199474-sql-update-query/#findComment-1047258 Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 You haven't mentioned what you want to do. We're not psychic. Looks to me like they're identical tables. =\ Quote Link to comment https://forums.phpfreaks.com/topic/199474-sql-update-query/#findComment-1047263 Share on other sites More sharing options...
karimali831 Posted April 23, 2010 Author Share Posted April 23, 2010 Lol. No I so haven't, have I? I want to Quote Link to comment https://forums.phpfreaks.com/topic/199474-sql-update-query/#findComment-1047310 Share on other sites More sharing options...
katierosy Posted April 26, 2010 Share Posted April 26, 2010 Yes you can write sql query on query window like update test8 t8,test9 t9 set t9.email=t8.email where t9.uId=t8.uId Using alias you can write this. Quote Link to comment https://forums.phpfreaks.com/topic/199474-sql-update-query/#findComment-1048537 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.