I'm having trouble with the following query:
INSERT INTO `pasajeros` ( `nombre`,`apellidos`,`email`,`password`,`telefono`)
VALUES ('Alexandra','Gonzalez','[email protected]','1234567!','04242344556' )
WHERE NOT EXISTS ( SELECT * FROM `transportistas` WHERE `email` = '[email protected]');
What do I have wrong in the code? I need to do an Insert only if mail is not used in that other table. I just added the statement WHERE NOT EXISTS
to the side but it seems I don't meet the required syntax, how can I improve my code?