There are same url in my table. Each row can be identified by id.
I want to delete same data in url
fields. I am using mysql.
I am trying select
one(identified by the maximum id) of them as a new tempary table as t2
, and then compare url
between the original table and the tempary table in my where
clause. There is syntax error in my statements, but I am not sure where it is. can u help me? thx guys.
The statements as follow:
delete from t1,
(select url, max(id) as id
from tjob_webpage as t1
group by url
) as t2
where t1.url = t2.url
t1.id < t2.id;