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?
Try using the mysql function TIMESTAMPADD:
You may try to check it first and see what this returns: