Filtering to reduce overhead optimizations

Source: Internet
Author: User

SELECT 0                         asID, T1. CUSTOMERNAME asCUSTOMERNAME, T.customerlevel asCustomerlevel,'Renewal Solicitation'  asBiztypename, T2. FULLNAME asFULLNAME, T.nexttrackdate asPlantime, T.insurancematuritydate asinsurancematuritydate, T.commercialenddate ascommercialenddate, T3. STATUSCODEDATE10 asSTATUSCODEDATE10, T4. FULLNAME asUNDERTAKER10 fromRt_custallocresult T Left JOINUm_customer T1 onT1. Customercode=T.customerno Left JOINCm_staff T2 onT2. Staffpkid=T.saleid Left JOIN (                SELECTT.frameno, T.undertaker10, T.statuscodedate10 from   (                           SELECTT1. Frameno, T1. UNDERTAKER10, T1. STATUSCODEDATE10, T1. Repairno,MAX(T1. Repairno) Over(PARTITION byT1. Frameno) asMaxrepairno fromRt_repair T1WHERET1. STATUSCODEDATE10 is  not NULL                           ORDER  byT1. Frameno, T1. STATUSCODEDATE10) TWHERERepairno=Maxrepairno) T3 onT3. Frameno=T.frameno Left JOINCm_staff T4 onT4. Staffpkid=T3. UNDERTAKER10WHEREVALUE (t.deleted,'0')= '0'        and((T.insurancematuritydatebetween '2015-01-21'  and '2015-02-05'               )               OR(t.commercialenddatebetween '2015-01-21'  and '2015-02-05')           )        andT.status<> ' About'        andT.status<> ' to'             

Filtering to reduce overhead optimizations

SELECT * from   (           SELECTT1. Frameno, T1. UNDERTAKER10, T1. STATUSCODEDATE10, T1. Repairno,MAX(T1. Repairno) Over(PARTITION byT1. Frameno) asMaxrepairno fromRt_repair T1WHERET1. STATUSCODEDATE10 is  not NULL           ORDER  byT1. Frameno, T1. STATUSCODEDATE10) TWHERERepairno=Maxrepairno

Filtering to reduce overhead optimizations

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.