Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. CONSTRAINT t1_201611_check CHECK (date_id >= 20161101 AND date_id <= 20161130)
  2. CONSTRAINT t1_201612_check CHECK (date_id >= 20161201 AND date_id <= 20161231)
  3.  
  4. select * from t1
  5. where date_id >= 20161201
  6. and date_id <= 20161231;
  7.  
  8. select * from t1
  9. where date_id >= to_char('2016-12-01'::date, 'YYYYMMDD')::int
  10. and date_id <= to_char('2016-12-31'::date, 'YYYYMMDD')::int;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement