SQL that list all birthdays within the next and previous 14 days

前端 未结 7 1584
梦谈多话
梦谈多话 2021-01-05 22:30

I have a MySQL member table, with a DOB field which stores all members\' dates of birth in DATE format (Notice: it has the \"Year\" pa

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 22:55

    There are a number of options, I would first try to transform by number of years between current year and row's year (i.e. Add their age).

    Another option is day number within the year (but then you have still to worry about the rollover arithmetic or modulo).

提交回复
热议问题