Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL INSERT INTO mit dualer Bedingung für IF NOT EXIST

Probieren Sie so etwas aus:

 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;