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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:28:07+00:00 2026-05-23T00:28:07+00:00

I was given a query similar to this select * from stuff where stuff.id

  • 0

I was given a query similar to this

select * 
from stuff where stuff.id = 1 
and start_Dt < = todays_date 
and End_Dt > = todays_date 

I asked the person who gave it to me why the date comparison, the answer was “The start and end dates are necessary to ensure a unique record match”

I’m confused, wouldn’t that comparison equate to any date possible?

  • 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-23T00:28:08+00:00Added an answer on May 23, 2026 at 12:28 am

    The reason is, that the IDs in your table are not unique, i.e. you can have more than one row with stuff.id = 1.
    But only one at any given time is active. This is checked with the date comparison: It returns the row with stuff.id = 1 that is currently valid. This is the row where the start date is in the past (start_Dt <= todays_date) and the end date is in the future (End_Dt >= todays_date).

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

Sidebar

Related Questions

I have a query similar to this: SELECT itemID FROM itemTable WHERE itemID LIKE
Given a query like: SELECT table1.field1 FirstField, table2.field2 SecondField FROM table1 INNER JOIN table2
I'm trying to use a PreparedStatement with code similar to this: SELECT * FROM
I need a single query that is similar to SELECT datetime FROM blog WHERE
Consider this query: SELECT F1,F2 FROM TABLE GROUP BY F1 Selecting F1 is valid,
Given a query like the following: DELETE FROM FOO WHERE ID in (1,2,3,4,....); Is
I am newbie to db programming and need help with optimizing this query: Given
Given the output of query: var queryResult = from o in objects where ...
Given data that looks similar to this: +---------+-----------+----------+ | country | city | district
I'm using this simple SQL query to retrieve data from two tables in my

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.