我有一个表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