表aggregate_monthly_conversations由列的用戶_A,用戶_B,user_B_location和表monthly_statistics僅由用戶_A和用戶_B如何添加到表中其他列與屬於價值
的我想列user_B_location添加到表monthly_statistics和用適當的值填充它。
爲了得到合適的值user_B_location爲用戶_B表monthly_statistics我可以運行下面的查詢:
SELECT t1.user_B_location
FROM aggregate_monthly_conversations AS t1
INNER JOIN monthly_statistics AS t2 ON t1.user_B = t2.user_B
無論如何,我不知道如何將其他列添加到monthly_statistics與查詢返回的值填充以上。如果有人能夠幫助撰寫解決這個問題的查詢,我將不勝感激。
謝謝!
您正在使用什麼數據庫? – 2010-10-27 13:18:05