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

  • Home
  • SEARCH
  • 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 7878687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:43:42+00:00 2026-06-03T03:43:42+00:00

I have a weather database which gets datasets about every 70 seconds (depends on

  • 0

I have a weather database which gets datasets about every 70 seconds (depends on when the weather-station delivers the data).
I want to graph it using Pchart but i have too many samples so the X axis is screwed up.
So i want the data for about every 5 minutes. (or every 30 minutes)
The query i currently have is this:

SELECT time, temp_out FROM wmr200 WHERE date(time) = curdate()

This gets the samples for the last 24 hours but there are too many.

  • 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-03T03:43:43+00:00Added an answer on June 3, 2026 at 3:43 am

    The following will get you a sample consisting of any data with a timestamp at :00, :05, :10 …

    SELECT time, temp_out FROM wmr200 WHERE date(time) = curdate()
        AND mod(minute(time),5) = 0
    

    I’m using the modulo function to check if the minute part of the time is (0 or) divisible by 5.


    If you need only one result for each time segment, we’ve got to get quite a bit more complex.

    SELECT concat(date(time),' ',hour(time),':',round(minute(time)/5,0)*5), 
           min(temp_out), avg(temp_out), max(temp_out) 
    FROM wmr200 
    GROUP BY date(time), hour(time), round(minute(time)/5,0)*5
    

    I don’t have access to a MySQL instance to test it out right now, but here’s the idea. It groups by every five minutes, by grouping by date, hour, and round(minute(time)/5,0)*5 – which rounds minute to the nearest 5.

    It selects the value of time that it should be grouped around, and the min, avg, and max temp_out, as I wasn’t sure which of these would best apply to your situation.

    If, however, your DB doesn’t have data for a five minute stretch (or 30 minute stretch, if that’s what you’re using), it still may not have data for a sample point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively large database (130.000+ rows) of weather data, which is accumulating
I have a program (temptrack) where I need to download weather data every x
I've got a large-ish MySQL database which contains weather information. The DB is about
I have hourly weather data. I've seen the function examples from here: http://casoilresource.lawr.ucdavis.edu/drupal/node/991 I'm
I have the following code, which will output the child-elements of the weather element.
Let's you have a science experiment called Weather and it records general information about
I have weather forecast data formatted like so: loc_id#location#state#forecast_date#issue_date#issue_time#min_0#max_0#min_1#max_1#min_2#max_2#min_3#max_3#min_4#max_4#min_5#max_5#min_6#max_6#min_7#max_7#forecast_0#forecast_1#forecast_2#forecast_3#forecast_4#forecast_5#forecast_6#forecast_7# 090180#Airey's Inlet#VIC#20091204#20091204#161830###12#19#12#21#12#19#12#17#11#20#12#20#11#17#Mostly clear.#Shower or two.#Light
I have this code written up to snatch some weather data and make it
I have written a code that searches specific string from database table.what i want
I have some id which i am getting from database matching some criteria specified

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.