I'm recently developing database api using java, vertx, gradle and mysql. I think I made a correct query but it shows me an error. Anybody knows the problem? Thanks in advance.
Query :
INSERT INTO USER VALUES('[email protected]', 'test', 'password')
WHERE NOT EXISTS (SELECT * FROM USER WHERE email='[email protected]')
Error :
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS (SELECT * FROM USER WHERE email='[email protected]')' at line 1