For example I have in database allowed ranges - (08:00-12:00), (12:00-15:00) and requested range I want to test - (09:00-14:00). Is there any way to understand that my test range is included in allowed range in database. It can be splited in even more parts, I just want to know if my range fully fits to list of time ranges in database.
Is there any way to match multiple date ranges for inclusion in other multiple ranges in postgresql
179 Views Asked by sl_bug At
1
There are 1 best solutions below
Related Questions in POSTGRESQL
- Why does adding a JOIN completely modify the query planner behaviour?
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Aggregate and count in PostgreSQL
- Rails HABTM: Select everything a that a record 'has'
- Trigger using data from inserted row
- Select results where joined table contains records with an attribute, but without another
- DB candidate as CouchDB/Schema replacement
- How do I properly add data in SQLAlchemy?
- Postgres in Conda Environment (Ubuntu 14.04)
- How to customize the output of the Postgres Pseudo Encrypt function?
- Split a large query (2 days) into pieces to increase the speed in Postgres
- Why does pg_search prefix not work like I expect?
- extracting meta info from a table psql using information_schema
- How to query a table in the database and copy it's data into one one?
- Update a table using info from a second table and a condition from a third table in Postgresql
Related Questions in RANGE
- Type Mismatch in passing Cells(3,4) as a Range argument
- VBA, moving some range down, if not matching time
- Search list for objects valid in a time range
- How do you use a range of numbers in an if statement in livecode?
- Process a list with a loop, taking 100 elements each time and automatically less than 100 at the end of the list
- Ionic - Disable Range Selection with Toggle
- Change range in chart from userform input
- Scala: how to create an "eager evaluated" list with many elements?
- How to select a range of my table
- Parameters required to reconstruct Range object creation
- Calculate Camera tilt angle
- excel 2013 vba code statement to Convert a table numeric cell type (2,4) into text cell type D2
- oracle sql - finding entries with dates (start/end column) overlap
- TextRange.getBoundingClientRect on PDF.js is giving all zeros in IE10/IE11
- Finding if a group of possible times falls within another range.
Related Questions in INCLUSION
- Text in html file is displayed but html tags are being ignored
- expose a private type for module extension in OCaml
- Avoid remote website inclusion
- Is there any way to match multiple date ranges for inclusion in other multiple ranges in postgresql
- Rails validation: Get rid of the invalid value message for nil when using an inclusion validator while still preventing nil from being saved
- RAILS 3 model validation inclusion in does not work
- PHP File Inclusion Issue: File not Executing as Expected
- Why is this Rails inclusion validation failing?
- "Unresolved include" errors in c++
- Strange behaviour with Javascript inclusion
- How can I apply my form to multiple templates in django
- Unresolved inclusion to everything
- Membership testing of floats in Pandas int64 dataframe produces unexpected result
- In mongo(ose) what projection field values are treated as inclusion?
- Best practice for handling dependencies?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You don't provide table structure, so I have no idea of data type. lets assume those are texts:
then how you can do it:
first you need to "cast" your time to timestamp, as there is no timerange in postgres, so we take same day for all times (
w.h = 2017-01-01) and convert a,b,c to ta,tb,tc with default including brackets (which totally fits our case).then use
unionhttps://www.postgresql.org/docs/current/static/functions-range.html#RANGE-FUNCTIONS-TABLE operator to get "glued" intervallastly check if the range is contained by the larger one with
<@operator