10.29 to 10.31th new registered user orders over $600 gift coupon in October
#3天内订单满600元且10月注册的用户订单明细SELECTA. City, a. User id,b. User name, date (b. Registration time) asRegistration date, B. User address, B. Contact number, A. Salesperson, A. Order date, A. Order amount, a. Identification from(#取这3天金额最高的一天SELECTA3. City, A3. User id,a3. Order date, A3. Sales clerk, A3. Order Amount, Case whenA3. Order Amount>= - Then">= -"ELSE NULL END asIdentification from(#10月注册用户 in this 3 day order amount per day descending by user ascending amountSELECTA1. City, A1. User id,date (A1. Order date) asOrder date, A1, sales clerk,SUM(A1. Amount) asOrder Amount from' A003_order ' asA1WHEREA1. City=Changchun andA1. Order Date>=" .-Ten- in" andA1. Order Date<" .- One- on" andA1. Amount>0 andA1. User IDinch ( SELECTA2. User ID from' A001_resterant ' asA2WHEREA2. Registration time>=" .-Ten- on" andA2. Registration time<" .- One- on" ) GROUP byA1. User id,date (A1. Order date)ORDER byA1. User ID,SUM(A1. Amount)DESC ) asA3GROUP byA3. User ID) asa Left JOIN' A001_resterant ' asB onA. User ID=B. User IDWHEREA. Identification=">= -"ORDER byA. Order AmountDESC
During MySQL activity, the month registered user is set to place the order _20160919