Skip to content
Advertisement

SQL calculating time between assignments

I have to write an SQL statement which contain a field that contain two different values consecutively but in the way I have wrote it, it return always null because it is interpreted as having the two value in the same time!

My conditions should be : (ci.field = ‘Group’ and ci.oldString = ‘Triage’ ) and (ci.field=’assignee’ and ci.newString is not NULL)

That means calculate time between: when the issue is assigned to group named Triage and when the issue is assigned to a person.

How can I fix it?

My SQL statement:

This is the table from which I should retrieve data

enter image description here

Advertisement

Answer

See my comment about the quality of your question but a hint at how to solve this goes like (assuming you can make sure this doesn’t create 1-n joins)

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