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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:14:20+00:00 2026-06-04T13:14:20+00:00

I am working on my final project and this is the query that returns

  • 0

I am working on my final project and this is the query that returns the list of all id’s, names and days.

select 
 c.id as id, i.full_name as n, day as d
 from
 (instructors i
 inner join courses c ON c.instructor_id = i.id)
 inner join exam_schedules e ON c.id = e.course_id

results samlpe:

id  name    day
9977    SCOTT, RAYMOND C.   wednesday
9467    FERNANDEZ, CYNTHIA E.   wednesday
9468    FERNANDEZ, CYNTHIA E.   wednesday
9493    FERNANDEZ, CYNTHIA E.   wednesday
9538    STEPHENS, RONNIE T. wednesday
9539    MYERS, RONNIE Y.    wednesday
9554    GARRISON, EUGENE A. wednesday

How can I get the list of all ID’s and count of combinations of name+day ?

Example above should produce:

9977    1
9467    3
9468    3
9493    3
9538    1
9539    1
9554    1
  • 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-06-04T13:14:21+00:00Added an answer on June 4, 2026 at 1:14 pm

    I used temporary table for clarity. It is possible to merge this into one query, but it is very hard to do without the real schema:

    CREATE TABLE tmp2 ( id int, name_day varchar(80) );
    
    INSERT INTO tmp2 (id, name_day) (SELECT c.id AS id, CONCAT(i.full_name, i.day) AS name_day
         FROM (instructors i
             INNER JOIN courses c ON c.instructor_id = i.id)
             INNER JOIN exam_schedules e ON c.id = e.course_id
             );
    
    SELECT id, counter FROM 
        (SELECT name_day, count(*) AS counter FROM tmp2 GROUP BY name_day) AS t1
        INNER JOIN
        tmp2
        ON t1.name_day = tmp2.name_day;
    
    DROP TABLE tmp2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is supposed to be a working project from my friend. He demonstrated the
While working on my final project for my AS/400 Course, I encountered this problem
I've been working on my final programming class project, and I am stuck right
Can someone help me with this issue? I currently working on my project for
A couple of friends and I are working on a project for our final
I'm working on a flash project that incorporates a lot of artwork done in
I am working on final project for my C# class. My project is a
I am working on a project where we need to parallelize this problem using
I'm working on a project that requires GUI, but I have no experience with
Working on a rails app for my final year project, and I want to

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.