How can I delete ghost database field between a special date?

Posted by Chiyou on Stack Overflow See other posts from Stack Overflow or by Chiyou
Published on 2012-10-06T15:31:29Z Indexed on 2012/10/06 15:37 UTC
Read the original article Hit count: 197

Filed under:

I have a mysql table with many user input and I want to delete ghost e-mail between a special date. I use this query and it seems to work very good:

DELETE u1 From tx_table u1 JOIN tx_table u2 USING (email) WHERE u1.tstamp < u2.tstamp
but I want to delete between a longer time. When I add 300 it seems to delete everything in my table:
DELETE u1 From tx_table u1 JOIN tx_table u2 USING (email) WHERE u1.tstamp < u2.tstamp+300
. How can I add 5 minutes to the tstamp with SQL?

© Stack Overflow or respective owner

Related posts about mysql