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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:04:38+00:00 2026-06-03T18:04:38+00:00

Intro: I have an database with table which contains column with hours, for example

  • 0

Intro: I have an database with table which contains column with hours, for example

08:30:00
08:45:00
09:30:00
12:20:00
...
18:00:00

the datatype in this column is “time”.
Question: is it possible with SQL to select all hours [ for eg. 10:00:00, 10:30:00, 11:00:00 etc. ] from range 08:00:00 to 18:00:00, which are not on the list?

edit:
Well, after thinking it out, the solution which You [ thanks! ] is not entirely perfect [ well it is perfect with details I gave u 🙂 ]. My application is allowing users to make an appointments which takes half an hour [ in this version of app ]. The column with time I gave u in my first topic is quite optimistic, because I didn’t put cover meetings for hours such as 11:45:00 or 13:05:00, which will end at 12:15:00 and 13:35:00, so I don’t really know from the top which hours I would be able to put in this extra table.

  • 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-03T18:04:42+00:00Added an answer on June 3, 2026 at 6:04 pm

    First, create a table T_REF with a column COL_HR with dates that have
    all the hours you want to report if not found in the original table.

    In MYSQL doing something like this should work

    SELECT DATE_FORMAT(COLUMN_NAME, '%H') FROM T_REF
    MINUS
    SELECT DATE_FORMAT(COLUMN_NAME, '%H') FROM ORIG_TABLE
    

    This will get and compare only the hours and report the ones that are not
    in your table (ORIG_TABLE).

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

Sidebar

Related Questions

I have an audit table in my SQL Server 2008 database which contains the
I have a user table in my database which contains two columns FirstName and
I have an (access) database table which contains data I would like to populate
I have a database in SQL Server containing a column which needs to contain
I have one table in sqlite database which contains five different columns as shown
I have an sqlite database called 'ProductDatabase.sql', which I have copied into my applications
I have a database with a table that contains Name and CompanyName . They
Situation: In my database I have a table in which records may reference other
I have a .txt file which contains a column of unixtime, like (1322485992.420381000), the
I have a table structure that contains a identifier column and a column that

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.