我有如下表:檢查兩個字段的表中沒有重複時,MySQL的INSERT
table (id,
longitude,
latitude,
longlat,
address,
description,
kind,
synonym,
primary key(id)
);
我需要檢查領域longlat
和description
中插入一行是獨一無二的,也有與相同組合沒有行longlat
和description
它插在它之前。
我該如何修改我的查詢?
"INSERT INTO yandex_social_objects (longitude,latitude,longlat,address,description,kind,synonym) VALUES (val_1),(val_2),(val_3)...(val_n)"
可能最容易只需添加一個唯一的密鑰對這些字段的表 – Kickstart 2013-03-01 09:29:34
耶同時創建longlat&說明 – 2013-03-01 09:30:04
但是一個獨特的組合,如果我嘗試插入另一行,其中'longlat'將被複制和「解密」 - 不是?是否插入此行? – Paul 2013-03-01 09:42:37