Created
November 20, 2020 12:28
-
-
Save hackimov/bde7f823934f869a901d3e64143f4805 to your computer and use it in GitHub Desktop.
Revisions
-
hackimov renamed this gist
Nov 20, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hackimov created this gist
Nov 20, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ UPDATE documents set document_total_sum = tmp_sel.summa FROM (SELECT documents.document_id, cast(sum(vat_total_sum) as numeric(20,2)) as summa from documents LEFT JOIN value_params vp on documents.document_id = vp.document_id LEFT JOIN goods g on vp.value_param_id = g.value_param_id WHERE param_id = '78624016-1195-4301-8576-cfabead6c9c9' group by documents.document_id) as tmp_sel WHERE documents.document_id = tmp_sel.document_id;