Skip to content

Instantly share code, notes, and snippets.

@suspecie
Created July 11, 2017 18:21
Show Gist options
  • Save suspecie/4ae8a758bb07e2b5240fdfb31a3556e2 to your computer and use it in GitHub Desktop.
Save suspecie/4ae8a758bb07e2b5240fdfb31a3556e2 to your computer and use it in GitHub Desktop.
script_tipo_registro
ALTER TABLE `InteractionModelMainData`
ADD COLUMN `fe_tipo_registro` BIGINT(18) NULL COMMENT 'tipo de registro do modelo de interacao Analitico - Sintetico' AFTER `tipo_registro`;
SELECT count(*) FROM InteractionModelMainData where tipo_registro = 'A';
SELECT count(*) FROM InteractionModelMainData where tipo_registro = 'S';
SELECT count(*) FROM InteractionModelMainData;
UPDATE InteractionModelMainData SET fe_tipo_registro = 1 where tipo_registro = 'A';
UPDATE InteractionModelMainData SET fe_tipo_registro = 2 where tipo_registro = 'S';
SELECT count(*) FROM InteractionModelMainData where fe_tipo_registro = 1;
SELECT count(*) FROM InteractionModelMainData where fe_tipo_registro = 2;
ALTER TABLE `InteractionModelMainData`
DROP COLUMN `tipo_registro`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment