我有一個表ps_feature:MySQL的比較兩個表,並添加缺少的值
-------------
|id_feature |
-------------
|1 |
|2 |
|3 |
|4 |
|5 |
|6 |
-------------
,並用表ps_feature_lang:
--------------------------------
|id_feature | id_lang | name |
--------------------------------
|1 | 1 | text1 |
|2 | 1 | text2 |
|4 | 1 | text3 |
|5 | 1 | text4 |
--------------------------------
是否有一個MySQL腳本在phpMyAdmin運行比較兩個表並在ps_feature_lang中添加缺少的值?
結果應該是:
--------------------------------
|id_feature | id_lang | name |
--------------------------------
|1 | 1 | text1 |
|2 | 1 | text2 |
|3 | 1 | N/A |
|4 | 1 | text3 |
|5 | 1 | text4 |
|6 | 1 | N/A |
--------------------------------
感謝。
可能的複製[SQL - 找到一個表中的記錄不以另一種存在(http://stackoverflow.com/questions/367863/sql-find-records-from-one-table-which-dont-exist-in-another) – Shadow