Mysql
 sql >> Base de données >  >> RDS >> Mysql

MySQL INSERT INTO avec double condition pour IF NOT EXIST

Essayez quelque chose comme ceci :

 INSERT INTO list_email($username.$rowname, fname, lname, list_email) VALUES(?,?,?,?,?)
     SELECT email_addr FROM list_email AS tmp
     WHERE email_addr NOT IN(
         SELECT email_addr FROM list_email WHERE email_addr = $post_addr)
         WHERE email_addr NOT IN (SELECT email_addr FROM list_no_email 
                                  WHERE email_addr = $post_addr)
     LIMIT 1;