删除sql相同记录的命令格式

来源:誉澄智能 2014/11/20 12:07:46      点击:

elete YC_DispHis_Rec_tmp SELECT * INTO YC_DispHis_Rec_tmp FROM YC_DispHis_Rec WHERE (1 = 2) insert into YC_DispHis_Rec_tmp Select * from YC_DispHis_Rec SELECT * FROM YC_DispHis_Rec WHERE (申请人员 = '王擎123') DELETE FROM YC_DispHis_Rec WHERE (id NOT IN          (SELECT MAX(ID)         FROM YC_DispHis_Rec         GROUP BY 派车编号)) DELETE FROM YC_DispRec_Info WHERE (id NOT IN          (SELECT MAX(ID)         FROM YC_DispRec_Info         GROUP BY 派车编号))