Posted on 2007-10-26 20:26
itspy 阅读(271)
评论(0) 编辑 收藏
来源:http://database.ctocio.com.cn/askexperts/216/7618716.shtml?ticket=ST-1398-lQWKhI5ZqQLqVscF67h8
select distinct
cust.fname
, cust.lname
, cust.phone
from orders as o
inner
join customers as cust
on cust.id = orders.cust_id
where o.date_ordered =
date_sub( current_date
, interval
7 - 2 * floor(dayofweek(current_date)/7)
+ floor((dayofweek(current_date)-2)/7)
day )
and o.date_shipped is null