Skip to content
Advertisement

Swapping one column to another

There are n number of parent tasks and each task has their actual start time and actual end time, now there are child task as well, for one parent task which ends with ‘createprovision’ i want to replace the end time with the start time of the child task which starts with ‘Preparations’

Sorry I am editing the question

The output is The output of the above code

I want to replace the actual end time of name column with value ‘slc-asset:global|win-global-createprovision‘ task with task activate time of the Preparation Provisioning virtual in the name column

Hope it make sense

Thanks

Rakesh

Advertisement

Answer

You have several options. Probably you could rewrite query to non-union version, but it’s too hard without data access and I cannot assist you with that. Second option is analitycal function:

Third option is subquery in first part of union. If your table may contain more than one such row use min(task_activate_time) or find proper row which should be presented in such situation.

You use group by, then distinct, then union. These are all costly aggregations. I think you could remove distinct and change union to union all.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement