如何在数据库中找出最近一周过生日的人 如何在数据库中找出最近一周过生日的人???????person birthday 1 1999-1-12 1988-3-33 1967-4-4如何查呀??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用日期函数和NOW()函数算一下嘛 适用于mysql4.1以上版本,还需要你自己去修剪时间的处理select * from table where birthday between DATE_SUB(NOW(),INTERVAL WEEKDAY(now()) DAY) and DATE_ADD(NOW(),INTERVAL 7-WEEKDAY(now()) DAY); select * from yourTable where date_format(birthday,'%m%d') between date_format(curdate(),'%m%d') and date_format(curdate()+interval 7 day,'%m%d')当您的问题得到解答后请及时结贴.http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html 求助一条sql。大家帮忙看看。 看看这个数据库的索引对不对? innodb_buffer_pool_size 问个关于innodb模糊的总数 mysql 求一mysql的sql语句 请教,如何将MS sql server 的数据库导到 mysql? postgres中如何检查一张表是否已经存在? create table ignore select 和 create table replace select的区别 求一个复杂表的查询 还是一道数据库面试题 MYSQL查询问题
select * from table where birthday between DATE_SUB(NOW(),INTERVAL WEEKDAY(now()) DAY) and DATE_ADD(NOW(),INTERVAL 7-WEEKDAY(now()) DAY);
where date_format(birthday,'%m%d') between date_format(curdate(),'%m%d') and date_format(curdate()+interval 7 day,'%m%d')
当您的问题得到解答后请及时结贴.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html