Guest User

Untitled

a guest
May 5th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Querying Where date_created without time is same as last_updated without time
  2. SELECT * FROM table_name
  3. WHERE DATE(date_created) = DATE(last_updated)
  4.  
  5. SELECT *
  6. FROM table_name
  7. WHERE DATE_FORMAT(date_created, '%Y-%m-%d') = DATE_FORMAT(last_updated, '%Y-%m-%d')
  8.  
  9. SELECT *
  10. FROM table_name
  11. WHERE day(date_created) = day(last_updated) and
  12. month(date_created) = month(last_updated) and
  13. year(date_created) = year(last_updated)
Advertisement
Add Comment
Please, Sign In to add comment