I'm having problems with the next sentence:
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's wrong in my code? I need to make an Insert if a email is not used in another table. That was my approach, but I can't figure it out why my query fails.