php - Inserting values to another table -


i have check if namesfroma tablea exist in namesfromb tableb using code.

select * tablea inner join tableb on(namefroma = namefromb) 

and able output names exist. want store names exist in both table table named "existed" , column "name". should this.

simply use insert ... select statement.

insert existed (existed.name) select a.name tablea inner join tableb on(namefroma = namefromb) 

see official mysql documentation more details.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -