I have a mySQL database and a table in which new records are created for the project. Each created project has a βproject nameβ and an event creation date (of type DATETIME).
There are two projects created with the same name, but if they are created by the same user in quick succession, we can safely assume that this was a mistake in the user part (double-clicking, updating the browser when event variables are sent, etc. d.).
How to write an SQL statement to check if a record with the same name exists, was it added in the last 10 seconds? So far I have the following, although I do not know how to check the last 10 seconds.
select * from projects where user = 'johnsmith' AND projectname = 'test' AND active='y' AND DATE(projectcreatedon) = CURRENT_DATE AND DATEPART() < ....?
source share