2012年9月21日

在Mysql中使用变量

摘要: 在Mysql中使用变量set @num = 1;select STOREID,CONTACTPHONE,count(*) ARRIVALNUM,CURRENT_DATE -@num COUNTDATE from cater_order_fact whereCONTACTPHONEin (select CONTACTPHONE from crm_dw.cater_order_fact where DATEDIFF(now(),DINNINGTIME) = @num)AND DINNINGTIME > date_sub(CURRENT_DATE -@num ,interval 3 month 阅读全文

posted @ 2012-09-21 17:11 艾思派客 阅读(317) 评论(0) 推荐(0) 编辑

导航