mysql去重语句,表名:gov_zczc 字段名:title, 删除title相同的数据,直留id最大的那个
delete from gov_zczc where id in (select id from (select id from gov_zczc where title in (select title from gov_zczc group by title having count(title)>1)
and id not in(select min(id) from gov_zczc group by title having count(title)>1)) as tmpresult)
mysql B表数据插入A表语句,两个表字段名相同
insert into A (classification,area,title,type,items,proxy,date,hour,purchaser,href)
SELECT b.classification,b.area,b.title,b.type,b.items,b.proxy,b.date,b.hour,b.purchaser,b.href
FROM B b
设计时间格式为 :例如2018-01-01 01:01:01
create_date = date.replace("年",'-').replace("月","-").replace("日",'').replace(".",'-')
date='20180101010101create_date = date[0:4]+'-'+date[4:6]+'-'+date[6:8]+' '+date[8:10]+':'+date[10:12]+':'+date[12:14]