mysql - Determine if month of date falls on a quarter of date -


i need write sql determine if current month based on quarter specified date.

if give '2015-04-09', function should determine if month equal 1, 4, 7, or 10. if give '2015-05-09', 2, 5, 8, 11. etc...

it work best if entire solution self contained within select statement. i'm not quite sure how approach , couldn't find fit situation. don't care day or year, need verify month.

it looks want know when expression true:

(mod(extract(month sysdate()), 3)) = (mod(extract(month <input date>), 3)) 

Popular posts from this blog