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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:02:15+00:00 2026-05-24T11:02:15+00:00

I have a SQL data like this: id date_start date_end identical_value 1 1 1

  • 0

I have a SQL data like this:

id  date_start  date_end  identical_value
1   1           1         a
2   1           3         b
3   2           3         c

I need return multiple semi-identical results, but only with ID and a new column. Below an example:

id  date_reference  identical_value
1   1               a
2   1               b
2   2               b
2   3               b
3   2               c
3   3               c

Note that the column date_reference starts on date_start and end on date_end.

I have a good notion on basic SQL, but I don’t undestand to much of loopings, and I think that maybe is essential here.

What I need: a good example — not exactly the answer — to I understand if it is possible or not, or what I need to search (functions, keyworkds…) of MySQL to do.

  • 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-24T11:02:15+00:00Added an answer on May 24, 2026 at 11:02 am

    Create a table with integers from 1 to some very large numbers. Then you can join on the number table to expand the date range:

    select  yt.id
    ,       num.Number as date_reference
    ,       yt.identical_value
    from    YourTable yt
    join    NumberTable num
    on      num.Number between yt.date_start and yt.date_end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have SQL data that looks like this: events id name capacity 1 Cooking
I have a SQL connection string like this: Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; I have
I have a datetime column in SQL Server that gives me data like this
I have a field type varchar in sql server. It contains data like 010109
Does SQL Server 2008 have a a data-type like MySQL's enum ?
I have an SQL statement where I would like to get data of 1200
I have a ton of data in a sql database which I would like
I have some data with a timestamp in SQL Server, I would like to
I have data that looks like this: entities id name 1 Apple 2 Orange
In SQL Server 2005 I have a table with data that looks something like

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.