Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:54:55+00:00 2026-06-13T07:54:55+00:00

I logging my temperature every 1-3 seconds with unix timestamp, I wish like get

  • 0

I logging my temperature every 1-3 seconds with unix timestamp, I wish like get row of data return by average every 1 minute period and last for 24 hour.

my logger table look like this:

unixtime    temp
1350899052  25.37
1350899054  25.44
1350899057  25.44
1350899059  25.44
1350899062  25.44
1350899064  25.44
1350899069  25.44
1350899071  25.44

and i wish like it return as

unixtime    temp
1350899052  25.37 -- average value of 1 minute range both unixtime and temp 
1350899054  25.44
1350899057  25.44

please advise how is mySQL command should i do ? thank.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:54:56+00:00Added an answer on June 13, 2026 at 7:54 am

    The following should work:

    SELECT ROUND(unixtime/(60)) AS minute, avg(temp)
    FROM table where unixtime >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY)) GROUP BY ROUND(unixtime/(60));

    Show date in normal format:

    SELECT from_unixtime(floor(unixtime/(60))*60) AS minute, avg(temp) FROM test where unixtime >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY)) GROUP BY floor(unixtime/(60))

    outputs:

    minute  avg(temp)
    2012-10-24 08:02:00 37.5
    2012-10-24 08:03:00 45
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For logging purposes, I would like to call the .ToString() method of every object
I have a database which stores temperature-logging data from various instruments. Data may be
For logging purposes, I'd like to create a logger that automatically adds the current
i need help with logging Zend Framewrok application ( version 1.11 ), every request..
java.util.logging.Logger override (overwrites) the file data instead of add to end of file. Is
My logging library has a simple DebugLogger that looks like this: public class DebugLogger
When logging in Go with log.Println , I frequently get 2012/05/13 16:45:50 evaluating %v(PANIC=3)
Lossy logging in log4net is great to get the details of events leading to
I am logging issues at my application like that: private static Logger logger =
We're logging some events in our servers, we get the current time of each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.