Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. insert into venda_produto (`cod`,`estoque`)
  2. values (49477,`estoque`+3), (98798,`estoque`+6)
  3. on duplicate key update `cod`=COALESCE( VALUES(`cod`), `cod`),`estoque`=COALESCE( VALUES(`estoque`), `estoque`)
  4.  
  5. INSERT INTO vendo_produto (cod, estoque)
  6. VALUES (49477, 3), (98798, 6)
  7. ON DUPLICATE KEY UPDATE estoque = estoque + VALUES(estoque);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement