創建第三個表我有兩個表,通過比較兩個表,而不用重複
first_table ---
column1 column2 column3 column4
1 4512 23-05-2013
1 4512 23-05-2013
2 8465 25-06-2013
9 8745 30-08-2013
second_table
column1_2 column2_2 column3_2 column4_2
1 2 4512 23-05-2013 23:23:54
1 4 4512 23-05-2013 11:15:59
2 4 8465 25-06-2013 15:26:47
9 5 8745 30-08-2013 18:26:29
我所要的輸出在第三個表作爲。 ..
column1 column2 column4_2
前2個表的計數爲4,我期望新表具有相同的行數。 請幫忙。我在這裏有多個重複行的問題。 謝謝。
你的'JOIN'中缺少一個'ON'子句 – wildplasser
你的連接條件是什麼?它是first_table.column_1 = second_table.column1_2? – wander
由於column1 == column1_2和column2 == column3_2什麼是阻止你只使用第二個表? – Jim