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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:56:46+00:00 2026-06-15T05:56:46+00:00

I have two different tables: checkin_out consists of two fields: emp_code , checked_date temp_days

  • 0

I have two different tables:

  1. checkin_out consists of two fields: emp_code, checked_date
  2. temp_days consists of two fields: id, date_value

Table checkin_out has following data:

emp_code | checked_date
-----------------------
001        2012-11-01
001        2012-11-02
001        2012-11-03
002        2012-11-01
003        2012-11-01
003        2012-11-02

While table temp_days has following data:

id  | date_value
-----------------
1     2012-11-01
2     2012-11-02
3     2012-11-03
4     2012-11-04
5     2012-11-05

From the above tables, I need to show the missing dates in the table temp_days; I need to query to get a result as follow:

emp_code  |  date_value
-----------------------
001          2012-11-04
001          2012-11-05
002          2012-11-02
002          2012-11-03
002          2012-11-04
002          2012-11-05
003          2012-11-03
003          2012-11-04
003          2012-11-05

If anyone could help, please! Thanks!

  • 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-15T05:56:47+00:00Added an answer on June 15, 2026 at 5:56 am

    The below works for a more complex data set with multiple emp_codes.

    SELECT  alldays.emp_code, alldays.date_value
    FROM    (
              SELECT date_value, emp_code
              FROM temp_days
              CROSS JOIN checkin_out
              GROUP BY date_value, emp_code
            ) alldays
            LEFT JOIN checkin_out C
                ON alldays.date_value = C.checked_date
                AND alldays.emp_code = C.emp_code
    WHERE   C.emp_code IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two fields in separate linked tables with the same data, but different
I have a table that has two different many-to-many relations to two different tables.
I have a table that has two foreign keys to two different tables with
I have two different tables from which I need to pull data blogs which
I have a need to sync auto_increment fields between two tables in different databases
I have two tables from two different databases. For example: Table: Articles1 - Database:
I have two different style definitions for tables: table { border: solid 1px #E8EEF4;
I have two different tables to track location of equipment. The equipment table tracks
I have two different tables, my first table contains the authorizations granted to other
I have two different tables and i decided to merge them into one table...

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.