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

  • Home
  • SEARCH
  • 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 6043373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:53:37+00:00 2026-05-23T06:53:37+00:00

Here is my table: table employee ( char(50) name datetime startdate datetime finishdate }

  • 0

Here is my table:

table employee (
    char(50) name
    datetime startdate
    datetime finishdate
}

Assume that at least one employee started everyday since the start of the business so that

 select distinct startdate from employee

would return every day the business was open. I’ve already provided a query to get every day the business was open, but would it be pair each day with the number of employees that were employed on that day? Essentially I am asking whether it is possible to count the number of employees for which (startdate <= day AND finishdate >= day) is true for each day and return that relation in one query.

  • 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-23T06:53:37+00:00Added an answer on May 23, 2026 at 6:53 am
    SELECT x.startDate, COUNT(e.startDate)
    FROM (SELECT DISTINCT startDate FROM employee) AS x
        INNER JOIN employee AS e
            ON x.startDate BETWEEN e.startDate AND e.finishDate
    GROUP BY x.startDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While designing a table my colleague here says that I should avoid identity column
Replaces Question: Update multiple rows into SQL table Here's a Code Snippet to update
Here's my table: CREATE TABLE `alums_alumphoto` ( `id` int(11) NOT NULL auto_increment, `alum_id` int(11)
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here is a simple scenario with table characters: CharacterName GameTime Gold Live Foo 10
Here's my scenario: I've got a table of (let's call them) nodes. Primary key
Here's my case: I have a table view showing contacts. Add button in the
Here is an example of what I've got going on: CREATE TABLE Parent (id
Here's the .jsp code: <table> <s:iterator value=allAgents> <tr> <td><s:property value=firstName /></td> <td><s:property value=middleName /></td>
I have a table with a structure like the following: LocationID AccountNumber long-guid-here 12345

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.