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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:55:39+00:00 2026-06-19T03:55:39+00:00

I have an Oracle 10g table containing 2 date columns, DATE_VALID_FROM from and DATE_VALID_TO.

  • 0

I have an Oracle 10g table containing 2 date columns, DATE_VALID_FROM from and DATE_VALID_TO.

MY_TABLE:

DATE_VALID_FROM |   DATE_VALID_TO   |   VALUE

15-FEB-13       |   17-FEB-13       |   1.833
14-FEB-13       |   14-FEB-13       |   1.836
13-FEB-13       |   13-FEB-13       |   1.824
12-FEB-13       |   12-FEB-13       |   1.82
11-FEB-13       |   11-FEB-13       |   1.822
08-FEB-13       |   10-FEB-13       |   1.826
07-FEB-13       |   07-FEB-13       |   1.814
06-FEB-13       |   06-FEB-13       |   1.806
05-FEB-13       |   05-FEB-13       |   1.804
04-FEB-13       |   04-FEB-13       |   1.796
01-FEB-13       |   03-FEB-13       |   1.801

The range on the date columns isn’t always one day (weekends).

I can retrieve the value for a single date like this,

select DATE_VALID_FROM, DATE_VALID_TO, VALUE 
from MY_TABLE
where DATE_VALID_FROM <= TO_DATE('16-FEB-13', 'dd-MON-yy')
and DATE_VALID_TO >= TO_DATE('16-FEB-13', 'dd-MON-yy')

Is it possible to retrieve the values for multiple random dates in a single query?

e.g. Values for the 1st, 5th, 6th, 11th and 16th Feb.

Producing this result set:

DATE_VALID_FROM |   DATE_VALID_TO   |   VALUE

15-FEB-13       |   17-FEB-13       |   1.833
11-FEB-13       |   11-FEB-13       |   1.822
06-FEB-13       |   06-FEB-13       |   1.806
05-FEB-13       |   05-FEB-13       |   1.804
01-FEB-13       |   03-FEB-13       |   1.801
  • 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-19T03:55:40+00:00Added an answer on June 19, 2026 at 3:55 am

    Try:

    select DATE_VALID_FROM, DATE_VALID_TO, VALUE 
    from MY_TABLE M
    JOIN (SELECT TO_DATE('01-FEB-2013') DATE_PARAM FROM DUAL UNION ALL
          SELECT TO_DATE('05-FEB-2013') DATE_PARAM FROM DUAL UNION ALL
          SELECT TO_DATE('06-FEB-2013') DATE_PARAM FROM DUAL UNION ALL
          SELECT TO_DATE('11-FEB-2013') DATE_PARAM FROM DUAL UNION ALL
          SELECT TO_DATE('16-FEB-2013') DATE_PARAM FROM DUAL) D
      ON M.DATE_VALID_FROM <= D.DATE_PARAM and M.DATE_VALID_TO >= D.DATE_PARAM
    

    SQLFiddle here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an oracle 10g database that has 2 tables: a REBATES table, and
I have an application that records activity in a table (Oracle 10g). The logging
I have created a table on an Oracle 10g database with this structure :
I have an Oracle 10g table that contains a # of log records. This
I have a table in Oracle 10g that contains some information as follows: SQL>
I have two very large enterprise tables in an Oracle 10g database. One table
I have an Excel file (which has data imported from Oracle 10G Database) one
using a Oracle 10g db I have a table something like this: create table
Oracle 10g DB. I have a table called s_contact . This table has a
I tried to create a pivot table created from a table in Oracle 10g.

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.