File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ _310 TILs and counting..._
132132-  [ Checking The Type Of A Value] ( postgres/checking-the-type-of-a-value.md ) 
133133-  [ Compute Hashes With pgcrypto] ( postgres/compute-hashes-with-pgcrypto.md ) 
134134-  [ Configure The Timezone] ( postgres/configure-the-timezone.md ) 
135+ -  [ Constructing A Range Of Dates] ( postgres/constructing-a-range-of-dates.md ) 
135136-  [ Count Records By Type] ( postgres/count-records-by-type.md ) 
136137-  [ Create A Composite Primary Key] ( postgres/create-a-composite-primary-key.md ) 
137138-  [ Create hstore From Two Arrays] ( postgres/create-hstore-from-two-arrays.md ) 
Original file line number Diff line number Diff line change 1+ # Constructing A Range Of Dates  
2+ 
3+ PostgreSQL offers a number of range types including the ` daterange `  type.
4+ This can be constructed using the ` daterange() `  function with two strings
5+ representing the lower and upper bounds of the date range respectively.
6+ 
7+ ``` sql 
8+ >  select  daterange(' 2015-1-1'  ,' 2015-1-5'  );
9+         daterange
10+ -- -----------------------
11+  [2015 - 01 - 01 ,2015 - 01 - 05 )
12+ ``` 
13+ 
14+ The lower bound is inclusive -- indicated by the ` [ `  character -- and the
15+ upper bound is exclusive -- indicated by the ` ) `  character.
16+ 
17+ [ source] ( http://www.postgresql.org/docs/current/static/rangetypes.html ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments