Solved

Record count by day / date

Posted on 2011-02-14
4
338 Views
Last Modified: 2012-06-27
Hi All,

What would be the sql for a record count by date for this table?

select txn_id, labelid, value, months, date, proc_dd, proc_mm,proc_yyyy from history

Thanks
0
Comment
Question by:lp84
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 8

Expert Comment

by:kingjely
ID: 34893686
select count(txn_id) as count, txn_id, labelid, value, months, date, proc_dd, proc_mm,proc_yyyy from history
group by day(date)

Something like the above

0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 34893725
like this probably

if you want more we need the data types of the columns and some sample
data would also be nice....


select proc_yyyy,proc_mm,proc_dd,count(*) as records
from history
group by proc_yyyy,proc_mm,proc_dd
order by 1 desc,2 desc,3 desc

Open in new window

0
 

Author Comment

by:lp84
ID: 34893742
they are all text and value is numeric and date is date
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34893897
select date, count(*) as recordcount  from history
group by date
0

Featured Post

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question