2016-07-15 68 views

回答

0

檢查MySQL的功能WEEKOFYEAR。你可以使用它像這樣得到的生日用戶當前周:

SELECT * FROM teachers WHERE WEEKOFYEAR(birthday) = WEEKOFYEAR(NOW()) 
0

使用功能WEEKOFYEAR

SELECT * FROM teachers WHERE WEEKOFYEAR(birthday) = WEEKOFYEAR(NOW()); 

WEEKOFYEAR範圍爲1至53

相關問題