I have another newbie question for the comunnity. I have 2 tables (let us say table1 and table2) in my database, both have email field. I would like to import emails from table1.email into table2.email but only those that are not already in table2.email. How would php function look like?
jshpro2 wrote:UNION, the union syntax says it selects as if a distinct of both tables together, so union your tables on the email:
(select `email` from a) UNION (select `email` from b)
this will not work because it will choose distinct entries from table1 and table2 which is not really what he is asking...d11wtq's way is the solution for this.....or you could do timvw's as well....that was a nice idea....