Last active
December 18, 2015 09:39
-
-
Save maravilloso/5763304 to your computer and use it in GitHub Desktop.
Hacer INSERT directamente desde una SELECT
This file contains 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 gesegenv | |
(idproces, idnuafti, iddocper, cldocper, idlote, clcorreos, dedirec2, dedirec3, feenvio, nuenvio, clestado) | |
SELECT idproces, idnuafti, iddocper, cldocper, '0001', '', dedirec2, dedirec3, TODAY, 1, '001' | |
FROM gedatostit | |
WHERE NOT EXISTS( | |
SELECT * FROM gesegenv WHERE idproces=gedatostit.idproces AND idnuafti=gedatostit.idnuafti | |
) | |
AND idproces='DP2' AND clcenmuf='2500' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment