mysql去除某些欄位重複的紀錄

rainbowbridg發表於2009-08-14

delete gweb_operation_apply as a from gweb_operation_apply as a ,
(select *,min(apply_aiid) from gweb_operation_apply where apply_time >= date_add(curdate(),interval -1 day) group by user_id_number,user_moblie) b
where a.apply_time >= date_add(curdate(),interval -1 day) and a.user_id_number = b.user_id_number
and a.apply_aiid > b.apply_aiid

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7916042/viewspace-1025281/,如需轉載,請註明出處,否則將追究法律責任。

相關文章