Query - Duplicate dates with different activities counts

I need a query that shows me duplicate dates with a count of different activities on those duplicate dates.
donnie91910Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Abhimanyu SuriDatabase EngineerCommented:
select date_column,activity_column,count(1) from table_name group by date_column,activity_column order by date_column.
0
donnie91910Author Commented:
also can this be added:

Where one of the records has a Status of Delete
0
slightwv (䄆 Netminder) Commented:
Please provide sample data and expected results.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Abhimanyu SuriDatabase EngineerCommented:
So you just want to check detail of records with delete status ?

Please post an example.
0
donnie91910Author Commented:
I need to produce a list of facilityID's (group onDuplicate dates and different Activities) that have duplicate Activity Dates with different Activities.
0
donnie91910Author Commented:
I need to produce a list of facilityID's (group on) that have duplicate Activity Dates with different Activities.
Please provide a query that does this.
0
donnie91910Author Commented:
All I need is the FacilityID displayed and the ActivityDate displayed that has the duplicate.  
Thanks in advance.
0
SharathData EngineerCommented:
SELECT FACILITYID, ACTIVITYDATE, COUNT(DISTINCT ACTIVITY) Cnt
  FROM your_table
 GROUP BY FACILITYID, ACTIVITYDATE
HAVING COUNT(DISTINCT ACTIVITY) > 1

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
donnie91910Author Commented:
Thanks this worked great!
0
donnie91910Author Commented:
The code worked great.  
Moderator please move  this to Private.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.