Skip to content
Advertisement

Calculate the time taken by a recursive function each time it is called… in SQL

I have the data like below

In the above data, function_a is called 4 times recursively and the start and end of the function are logged. I need to capture the time taken for each function call. The output for the above table should look like below.

Advertisement

Answer

You can enumerate the calls and then aggregate. This enumerates the starts and stops

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