Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MySQL INSERT INTO com condição dupla para IF NOT EXIST


Tente algo assim:
 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;