0
我想合併兩個表,看起來像這樣,放到一個表中,並且用於重複的鍵行,以在合併表中添加最舊的DateAdded
值。MySQL - 合併兩個表格 - 條件
(Key1,Key2)
是PRIMARY KEY
。
+-----------+-----------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-----------+------+-----+-------------------+-----------------------------+
| Key1 | int(10) | NO | PRI | | |
| Key2 | int(10) | NO | PRI | | |
| DateAdded | DATETIME | NO | | | |
+-----------+-----------+------+-----+-------------------+-----------------------------+