I have checked/compared SQL statement several times, but it is still not working. I am using WorkBench 6.3 with MySQL. It gives me an error:
1064 syntax error: 'IF' is not a valid input at this position.
IF(EXISTS(SELECT * FROM RECORDS WHERE FORMID = 200002016 AND TimeUploaded > '2016-07-17 03:13:39' AND TimeUploaded < '2016-07-17 03:13:39'))
Begin
SELECT TimeUploaded from RECORDS
End;
You cannot use IF
in an SQL statement. You can only use it in a stored procedure or a function.
You can rewrite your statement like this:
SELECT TimeUploaded from RECORDS
WHERE FORMID = 200002016
AND TimeUploaded > '2016-07-17 03:13:39'
AND TimeUploaded < '2016-07-17 03:13:39'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With