Hi, I'm working on putting duration metrics, but w...
# ask-questions
p
Hi, I'm working on putting duration metrics, but want to confirm the units I should be returning for the metric value metric. There's an old comment in there that alludes to seconds, but the values seem way off. Seems like hours might be more accurate?
Copy code
SELECT
  cc.user_id as user_id,
  cc.time as timestamp,
  TIMEDIFF(HOURS, u.joindate, cc.time) as value
FROM
  checkout_complete as cc
JOIN users as u ON cc.user_id = u.user_id
GROUP BY cc.user_id, cc.transaction_id, cc.ORDER_SKUS, cc.time, u.joindate