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 8713835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:26:34+00:00 2026-06-13T05:26:34+00:00

I’ve got a table thats just three columns, ID, DATETIME, VALUE Each DATETIME is

  • 0

I’ve got a table thats just three columns, ID, DATETIME, VALUE

Each DATETIME is from various samples during the day, from different meters.

I need to perform a math function on each value eg. (value * 60 * 10)/1000000 = new_value, and then group new_value by DATE(datetime), and sum the values for each date, and do this for a select group of ID’s.

The result I need is each DATE, with its sum value of those meters.

I’ve tried:

SELECT date(sub_meter_data.date) as date, 
sum(CASE WHEN sub_meterID = '58984' OR '58985' OR '58986' OR '58987' THEN (((value*60)*10)/1000000) ELSE 0 END) as value
FROM `sub_meter_data` WHERE
date(sub_meter_data.date) > '2012-10-01'
GROUP BY date(sub_meter_data.date)

Here’s some sample data:

sub_meterID       date           value
58984     2012-10-18 23:23:05.000   94.82643
58982     2012-10-18 23:28:52.000   97.43638
58984     2012-10-18 23:33:04.000   100.1923
58985     2012-10-18 23:43:01.000   97.93111
58984     2012-10-18 23:53:05.000   93.02759
58986     2012-10-19 00:03:03.000   88.29563
58984     2012-10-19 00:13:02.000   81.23074
58987     2012-10-19 00:23:07.000   86.37943
58984     2012-10-19 00:33:04.000   88.64834
  • 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-13T05:26:36+00:00Added an answer on June 13, 2026 at 5:26 am

    Please try below:

    SELECT date(`date`), 
           sum(((value*60)*10)/1000000) as value
    FROM `sub_meter_data` 
    where date(sub_meter_data.date) > '2012-10-01' 
          and sub_meterID in('58984','58985','58986','58987')
    group by date(`date`);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.