Find Jobs
Hire Freelancers

average calculation in SQL

$15-20 USD

Closed
Posted almost 16 years ago

$15-20 USD

Paid on delivery
Dear Coders, I need a SELECT-command for the calculation of average data in a MySQL-database. I've got a MySQL database with normalized structure: timestamp (timestamp); sensor (int); value (dec) Name of the table: "dataset" "timestamp" is MySQL-timestamp, not UNIX-timestamp "value" and "sensor" can be NULL Unique Index is on fields: "timestamp" and "sensor" The data is 10-minute-average data from a weather station. Please have a look at the attached Excel-file! The first sheet "database-entries" contains dumped data from the SQL database. That's "real data", which you need to work with. Sometimes, a sensor has a failure - then its value is NULL. I've marked this with yellow color in the example. On the second sheet "average (30 minutes)" you can see the resulting table, I want to get. timestamp (timestamp); sensor (int); value (double); errors (int) "timestamp" is MySQL-timestamp "value" is the average data for the sensor "errors" is the count of NULL value in a sensor (see Excel-file) It should be possible to calculate various average data: - for 30 minutes - for 60 minutes - for 24 hours A small example for calculating 30-minute-average: 2008-05-05 07:00;0;32 2008-05-05 07:10;0;12 2008-05-05 07:20;0;15 2008-05-05 07:30;0;95 "2008-05-05 07:00" is NOT used for this calculation, since it's 10-minute-average data already! 07:00 contains the measurements from 06:51 to 07:00. result should be: 2008-05-05 07:30;0;40,66666667 (12 + 15 + 95) / 3 = 40,66666667 Please read the Excel-file correctly, please ask if you've got questions. Would be happy for a nice and easy solution with good support. Best regards, Lars-Daniel ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform any
Project ID: 3929928

About the project

11 proposals
Remote project
Active 16 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
11 freelancers are bidding on average $14 USD for this job
User Avatar
See private message.
$12.75 USD in 2 days
4.9 (242 reviews)
5.8
5.8
User Avatar
See private message.
$17 USD in 2 days
5.0 (39 reviews)
5.3
5.3
User Avatar
See private message.
$17 USD in 2 days
4.8 (42 reviews)
4.8
4.8
User Avatar
See private message.
$17 USD in 2 days
5.0 (32 reviews)
4.7
4.7
User Avatar
See private message.
$12.75 USD in 2 days
4.9 (7 reviews)
3.5
3.5
User Avatar
See private message.
$17 USD in 2 days
5.0 (25 reviews)
3.4
3.4
User Avatar
See private message.
$8.50 USD in 2 days
4.8 (7 reviews)
3.0
3.0
User Avatar
See private message.
$4.25 USD in 2 days
5.0 (6 reviews)
2.5
2.5
User Avatar
See private message.
$12.75 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$12.75 USD in 2 days
0.0 (1 review)
1.9
1.9
User Avatar
See private message.
$17 USD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of GERMANY
Dortmund, Germany
5.0
11
Payment method verified
Member since Feb 7, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.