Advertisement
Guest User

Untitled

a guest
Jul 20th, 2012
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. MySQL DATE_SUB Birthday Select Satement
  2. select
  3. name,
  4. email,
  5. birthday
  6. from members
  7. where
  8. month(birthday) = month(now())
  9. and dayofmonth(birthday) = dayofmonth(now());
  10.  
  11. select
  12. name,
  13. email,
  14. birthday
  15. from members
  16. where
  17. month(birthday) = month(DATE_SUB(NOW(), INTERVAL 1 WEEK))
  18. and dayofmonth(birthday) = dayofmonth(DATE_SUB(NOW(), INTERVAL 1 WEEK));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement