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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:26:47+00:00 2026-05-29T05:26:47+00:00

I have Emp table with following values Emp_Id Emp_Name Subject Dates 001 Smith Java

  • 0

I have Emp table with following values

Emp_Id  Emp_Name    Subject        Dates
001      Smith      Java         07-02-2012
001      Smith      oracle       08-02-2012
001      smith      C++          10-02-2012
002      john       java         01-01-2012
002      john       SE           10-01-2012
002      john       c            10-01-2012  
001      smith      physics      04-01-2012
001      smith      c#           07-02-2012
001      smith     javascript    07-02-2012 

Now as we can see here smith studied only 3 days for month February and 1 for month Jan
while john studied only 2 days for month January.

How can we calculate this count for any employee?
As a e.g:Output should be in following way.

Emp_Id   Emp_Name  Month_Year   No_Of_Days_Studied_In_Month
001      smith      Feb12                 3
001      smith      Jan12                 1
002      john       Jan12                 2
  • 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-29T05:26:49+00:00Added an answer on May 29, 2026 at 5:26 am

    You can GROUP BY YEAR(Dates), MONTH(Dates) and do a COUNT.

    TRY:

    SELECT emp_id,
           emp_name,
           Date_format(DATE, '%b%y') AS dates,
           COUNT(*) AS No_Of_Days_Studied_In_Month
    FROM   emp
    GROUP  BY Date_format(DATE, '%b%y'), emp_name
    ORDER  BY emp.emp_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a EMPLOYEE table with EMP_ID,EMP_NAME,EMP_ADDRESS. EMP_ID should have the following format. EMP001
I have a table emp with following structure and data: name dept salary -----
I have two tables TABLE : EMPLOYEE EMP_ID EMP_NAME EMP_TYPE 1 Shwetha 1 2
Given: Oracle 10.2g is the database I have a table called emp. emp has
I have a table names 'emp'. Columns are: uid,emp_name,emp_dept,emp_sal. Now i want to find
I have table as follows emp_id, emp_name, emp_address, emp_salary, emp_rating I would like to
SQL Server procedure can return result sets. I have a table emp(emp__id, emp__name, ...)
I have a timeclock table with the following elements ( id(pk) , action ,
I have the following 2 entities: @Entity(name = Employee) @Table(name = EMPLOYEE) public class
This is the question I have. Develop a salary sheet from emp table consisting

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.