insert into creditcardstypes(`idcreditcards`,`idcardtype`) select idcreditcards,'13' from creditcards where creditcardsname like '%cash%'; insert into creditcardstypes(`idcreditcards`,`idcardtype`) select idcreditcards,'14' from creditcards where creditcardsname like '%sky%';