This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / MySQL: How can I combine two tables into one table. they have same user_id column. Can I do it just through SQL Statement?
-prod4less(prod4less);
2004-11-8
(#1971781@0)
-
最笨的方法, 读出来再insert到一个新表
-expertune(伪劣);
2004-11-8
(#1971784@0)
-
no better way do this work? Thanks.
-prod4less(prod4less);
2004-11-8
(#1971797@0)
-
其实我不太清楚你的需求, 再说详细点...看楼下bingle问的
-expertune(伪劣);
2004-11-8
(#1971808@0)
-
combine?你指的是union还是join
-bingle(bingle);
2004-11-8
(#1971799@0)
-
e.g. 3 columns in table A. 4 columns in table B. one column is same:user_id in 2 tables. I just want to move 3 columns from table B to table A (need add another 3 columns). and keep all table A data.
-prod4less(prod4less);
2004-11-8
(#1971806@0)
-
creat a view
-oasis(oasis);
2004-11-8
(#1971811@0)
-
是把a表加长还是拓宽?
-dts(独頭蒜※惜语如金);
2004-11-8
(#1971817@0)
-
拓宽!
-prod4less(prod4less);
2004-11-8
(#1971831@0)
-
你为什么要这样干呢? 这样不是数据库的优势吗?
-expertune(伪劣);
2004-11-8
(#1971822@0)
-
我理解错题意了,我还以为是要查询,原来是要改表。
-bingle(bingle);
2004-11-8
(#1971837@0)
-
我已经第二次没追上你的帖了。是拓宽a表三列,空白部份用b表的同id补,能补多少是多少。我感觉用仅一句SQL挺难写的。
-dts(独頭蒜※惜语如金);
2004-11-8
(#1971848@0)
-
不明白为什么要Denormalzation,是Performance Issues么?
-charleslike(愚人);
2004-11-8
(#1971839@0)
-
I need update table A. and take off table B. thanks.
-prod4less(prod4less);
2004-11-8
(#1971844@0)
-
ALTER TABLE, Add columns First
-guestagain(guest again);
2004-11-8
(#1971860@0)
-
I had add 3 columns.
-prod4less(prod4less);
2004-11-8
(#1971864@0)
-
UPDATE a,b SET a.column_a = b.column_a
WHERE a.user_id = b.user_id;
-bingle(bingle);
2004-11-8
(#1971876@0)
-
so? update A, B set A.column1 = B.column1,A.column2 = B.column2,A.column3 = C.column3 where A.user_id = B.user_id
-guestagain(guest again);
2004-11-8
(#1971877@0)
-
Then update
-guestagain(guest again);
2004-11-8
(#1971861@0)
-
不知道MYSQL,要是MS SQL的话, UPDATE A SET A.COL1=A.COL1, A.COL2=B.COL2, A.COL3=B.COL3 INNER JOIN B ON (A.USER_ID=B.USER_ID)
-charleslike(愚人);
2004-11-8
(#1971891@0)
-
Thank you everybody! I appreciated for your help!
-prod4less(prod4less);
2004-11-8
(#1971912@0)
-
it's working fine. UPDATE respondents r1,respondentsurveys r2 SET r1.survey_id = r2.survey_id,r1.survey_date=r2.survey_date,r1.duration=r2.duration WHERE r1.respondent_id = r2.respondent_id;
-prod4less(prod4less);
2004-11-8
(#1971922@0)
-
,respondentsurveys 可省。
-dts(独頭蒜※惜语如金);
2004-11-8
(#1971929@0)
-
wrong
-xanada(㊣流水);
2004-11-8
(#1971953@0)