Please help me with a query. Let's say we have a table with the column:
- Transactions
- Start time
- End time
Now, a query is required with the calculated column of I (value = endtime-startimem), in fact I need a user of the group (there is an FK for the user in the transaction) and the transaction They have to sort through the average time spent for them.
You should look at the DateDiff function. You have not specified the units of timepoints, so I put the seconds in my solution:
from ... to join dbo.Users as U (Choose T. User, average According to Z.UserId = U.Id order at Z on the ZTimespan Desc (DateDiff, T. starttime, tiandtime)) as the average time in the form of DGOs as T.UserId by T group. >
Comments
Post a Comment