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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:22:24+00:00 2026-05-28T18:22:24+00:00

I need help with a SQL statement. The goal is to count the amount

  • 0

I need help with a SQL statement. The goal is to count the amount of alarms of each date. My table looks something like this:

|----DATE----|---COUNTER---|---ALARM_ID---|
|2012-01-01  |     30      |      1       |
|2012-01-01  |     20      |      2       |
|2012-01-01  |     10      |      3       |
|2012-01-02  |     5       |      1       |
|2012-01-02  |     25      |      2       |
|2012-01-02  |     12      |      3       |
|2012-01-03  |     33      |      1       |
|2012-01-03  |     43      |      2       |
|2012-01-03  |     11      |      3       |

And I’m looking for a SQL statement that gives this result:

|----DATE----|---COUNTER---|
|2012-01-01  |     60      |
|2012-01-02  |     42      |
|2012-01-03  |     87      |

I’ve been working on this SELECT date, SUM(counter) FROM all_stats but all I get is:

|----DATE----|---COUNTER---|
|2012-01-01  |     60      |

Do I have to create a loop to go through all dates and count?

Thanks in advance, Steve-O

  • 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-05-28T18:22:25+00:00Added an answer on May 28, 2026 at 6:22 pm
    SELECT date, SUM(counter)
    FROM all_stats
    GROUP BY date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help converting this SQL statement, into EF4: Select Posts.PostID, Post, Comment from
Okay, I need help. I'm usually pretty good at SQL queries but this one
I need some help writing a SQL statement. I have two tables in a
I need your help building a SQL statement I can't wrap my head around.
I need help re-factoring this legacy LINQ-SQL code which is generating around 100 update
I need help reproducing the following SQL statement to a statement that SQLite understands.
I need some help converting the SQL found below to an equivalent LINQ statement
Can someone help me with this SQL statement. I run it on the SQL
I need help. I have to do a very specific SQL Statement and I
I need help with a SQL convert statement. I have NetQuanity (masterTable) which is

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.