We help IT Professionals succeed at work.
Get Started

Oracle SQL get counts from single table based on date and column

mikeysmailbox1
on
539 Views
Last Modified: 2014-05-08
Hi I need help with the following.

I have a table that has the following columns

TABLE     APPLICATION   GROUP   JOBNAME     DATE      
-------   -----------   -----   --------    -------  
AAA       MYAPP1        AAZ     Command1    20140401  
BBB       MYAPP1        DAZ     Command1    20140401  
BBB       MYAPP1        DAZ     Command2    20140402  
AAA       MYAPP1        AAZ     Command1    20140403  
CCC       AZZCX         AAZ     Command1    20140401  
AAA       MYAPP         AAB     Command3    20140405  
CCC       MYAPP         AAD     Command5    20140401  
DDD       MYAPP         AAZ     Command1    20140501  
AAA       MYAPP         AAB     Command1    20140401  
                                                     
                                                     
This is the output I need.                                                      

                                                                 
APPLICATION     GROUP     JOBCOUNT                    
-----------     ------    --------                    
MYAPP1    AAZ       1                          
                  DAZ       2                          
AZZCX       AAZ       1                          
MYAPP     AAB       2                          
                 AAD       1                          
                  AAZ       1                          


I need to search for the Application then the Group and count if the Jobname exist at least once.
and if the date is between X and Y.

Not sure how this would work.

Thanks,

Mike
Comment
Watch Question
EE Topic Advisor
CERTIFIED EXPERT
Most Valuable Expert 2014
Awarded 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE