我有兩個不同的表table_usernames和jos_users,我需要匹配字段用戶名和用戶從這兩個表列,然後如果列行匹配我需要表-usernames(註冊日期)列複製到jos-users(註冊)列的行字段。到目前爲止,我已經找到了最接近的事是Mysql不同的表,複製,匹配字段,但列的行是隨機的
update
table1 t1
join table2 t2 on t2.field = t1.field
set
t1.field1 = t2.matchingfield
where
t1.whatever = t2.whatever
但是,這並不像它會在我的情況下工作,只是想驗證之前,我毀了我的數據庫,找到我的備份已損壞...謝謝你提前
驗證如果你不用「無論」等替換實際的列名和表名,那肯定會有所幫助,你不覺得嗎? – fancyPants