Created
October 4, 2013 13:01
-
-
Save dodopok/6825544 to your computer and use it in GitHub Desktop.
Copia registro que não existe em outra tabela para outra tabela
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into almoxarifado_produtos (produto_id, almoxarifado_id, quantidade, created, modified, group_id, user_id) | |
SELECT id, almoxarifado_id, 0, '2013-10-04 10:00:00', '2013-10-04 10:00:00', group_id, user_id FROM `produtos` WHERE NOT EXISTS(SELECT id FROM almoxarifado_produtos WHERE produto_id = produtos.id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment