ANTON KADACH

Generation

text to sql syntaxWed, 18 Jan 2023

with cte as ( select cr.section_display, array_agg(cr.changed_entity_id)as ar from barsup_change_request.change_record cr join barsup_change_request.change_request_change_proposal_link plink on plink.change_proposal_id =cr.change_proposal_id join barsup_change_request.change_request creq on creq.id = plink.change_request_id where creq."number" = 'G1-4-2021/005' group by section_display) update reg_proj_fin_source rpfs -- меняем тут раздел 1 set version_actual_period_end = '2021-07-30 18:00:00' -- тут менять where version_meta_id in (select unnest(ar) from cte where section_display = 'Финансовое обеспечение') and version_actual_period_end ='2021-08-02 05:42:14'; -- тут поменять дату окончания with cte as ( select cr.section_display, array_agg(cr.changed_entity_id)as ar from barsup_change_request.change_record cr join barsup_change_request.change_request_change_proposal_link plink on plink.change_proposal_id =cr.change_proposal_id join barsup_change_request.change_request creq on creq.id = plink.change_request_id where creq."number" = 'G1-4-2021/005' group by section_display) update reg_proj_fin_source rpfs --аналогично set version_actual_period_start = '2021-07-30 18:00:01' where version_meta_id in (select unnest(ar) from cte where section_display = 'Финансовое обеспечение') and version_actual_period_end > current_timestamp and version_actual_period_start >'2021-08-02 05:42:14';

Questions about programming?Chat with your personal AI assistant