Guest User

Untitled

a guest
Jan 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. select * from my_table
  2. where year(my_date_col) = 2018
  3. and month(my_date_col) = 1
  4.  
  5. SELECT *
  6. FROM my_table
  7. WHERE my_date_col >= '2018-01-01'
  8. AND my_date_col <= '2018-01-31'
  9.  
  10. SELECT *
  11. FROM my_table
  12. WHERE my_date_col >= '2018-01-01'
  13. AND my_date_col <= LAST_DAY('2018-01-01')
Add Comment
Please, Sign In to add comment