SQL statements (several tables join together to query, get the number to the more than 10 data)

Source: Internet
Author: User
SQL statements (a couple of tables together to query, get the first few to the more than 10 data):

1. If there are a,b,c,d four tables, a,b,c,d are linked together as follows: The ((A Inner join B By A.Id =B.AId) Inner join C By B.Id =C.BId)Inner join D By C.Id =D.CId Where 条件一 AND 条件二... ; above is sorted by time. Get 11th through 20th data from. How should SQL statements be written?

Reply content:

1. If there are a,b,c,d four tables, a,b,c,d are linked together as follows: The ((A Inner join B By A.Id =B.AId) Inner join C By B.Id =C.BId)Inner join D By C.Id =D.CId Where 条件一 AND 条件二... ; above is sorted by time. Get 11th through 20th data from. How should SQL statements be written?

Mysql:

SELECT * FROM (select: (A Inner join B by a.id =b.aid) Inner join C by b.ID =c.bid) Inner join D by C.id =d.cid Wh ere condition one and condition two ...) As Table LIMIT 11,10

The above is the SQL statement (several tables in a joint query, get the first few to the more than 10 data) of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.