During MySQL activity, the month registered user is set to place the order _20160919

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.