Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from flows
- where title ='Заключение контрактов по плану-графику 2021';
- with sd as
- (select
- id as sid,
- datasource_id
- from steps
- Where 1=1
- and step_type = 6
- and datasource_id is not null
- ),
- ssd as
- (
- Select
- unnest(s.step_ids) sid,
- flow_id
- From steps s
- Where 1=1
- and step_type = 6
- )
- Select
- ssd.*,
- sd.datasource_id
- From ssd
- join sd on ssd.sid=sd.sid
- Where flow_id=247
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement