Those notorious SQL

Source: Internet
Author: User

    • Two or more tables are associated, not written in the where condition, a large number of Cartesian values, which can cause problems in the database.
Select *  from  Left Join  on =  Left Join  on = d.id
    • Multiple Table association queries, where conditions use a variety of functions, resulting in an invalid index. The amount of data that will cause the query to look like a snail after hitting it.
SelectTrim (D.circuitid) asCircuitid,trim (D.code) asCode,trim (d.oldname) asOldname,trim (D.circuittype) asCircuittype,trim (d.status) asStatus,trim (D.customerid) asAcustomerid,trim (D.alinkman) asAlinkman,trim (D.zlinkman) asZlinkman,trim (D.alinkmantel) asAlinkmantel,trim (D.zlinkmantel) asZlinkmantel,trim (d.busi_no) asBusi_no,trim (d.service_serial) asService_serial,trim (a.region_id) asRegionID,2  asSORTID fromtest1 a,test2 b,test3 c,test4 DwhereTrim (a.room_id)=Trim (B.roomid) andTrim (B.neid)=Trim (C.neid) and(Trim (C.portid)=Trim (d.aendname)orTrim (C.portid)=Trim (d.zendname))

Those notorious SQL

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.