Skip to content

Instantly share code, notes, and snippets.

@primogf
Created April 10, 2017 13:23
Show Gist options
  • Save primogf/2cdff358791e935d6a8fc3e6bd4c7459 to your computer and use it in GitHub Desktop.
Save primogf/2cdff358791e935d6a8fc3e6bd4c7459 to your computer and use it in GitHub Desktop.
update Document set stat = 0 where id_documento in (
select id_documento from (select d.id_documento from DocumentOrigin o
inner join Document d on d.id_documento = o.id_documento
where o.id_registro in (
128417,
128426,
128427,
128458,
128473,
128494,
128561,
128564,
128607,
128608,
128684,
128686,
128704,
128756,
128887,
128928,
128933,
129064,
129099,
129102,
129104,
129161,
129253,
129254,
129255
) and d.stat <> 0 and o.id_tabela_sistema = 1071 and d.id_documento <> 168535) as view);
update DocumentOrigin set id_tabela_sistema = 1071 where id_tabela_sistema = 238 and id_documento in (
select id_documento from (select d.id_documento from DocumentOrigin o
inner join Document d on d.id_documento = o.id_documento
where o.id_registro in (
128417,
128426,
128427,
128458,
128473,
128494,
128561,
128564,
128607,
128608,
128684,
128686,
128704,
128756,
128887,
128928,
128933,
129064,
129099,
129102,
129104,
129161,
129253,
129254,
129255
) and d.stat <> 0) as view);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment