MySQL Forums
Forum List  »  Newbie

MySQL query for time stamp diff?
Posted by: Hans Peter
Date: September 22, 2016 07:18AM

Hello,

i'm quite new to MySQL and have a question related to one query.
I have a table with the following fields:
ID (Auto Index), userID, date (Auto date)
The purpose is not so relevant i guess.

What i'm trying to realise is to find out what is the average delay between the timestemps of one user.
But i only want to take delays into account if the delay of the next entry is only 5 seconds or smaller.

Currently i query:
SELECT ID, date FROM `pings` WHERE userID = 1
and calculate the average with php. but i guess mySQL could do it faster right?

Options: ReplyQuote


Subject
Written By
Posted
MySQL query for time stamp diff?
September 22, 2016 07:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.