Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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)