Access Database multi-Table connection Query

Source: Internet
Author: User
The first time I write A multi-Table query in Access, I wrote the statement in the MS database. The syntax error is returned. The original multi-Table connection query in Access is different from that in Table A, B, and C, A is associated with B and B is associated with C. The ID key is used for association. General Syntax: select * fromAinnerjoinBonA. IDB. IDinnerjoinConB. IDC. ID: an error is reported in Access.

The first time I write A multi-Table query in Access, I wrote the statement in the MS database. The syntax error is returned. The original multi-Table connection query in Access is different from that in Table A, B, and C, A is associated with B and B is associated with C. The ID key is used for association. General Syntax: select * from A inner join B on. ID = B. ID inner join C on B. ID = C. ID: an error is reported in Access.

The first time I write a multi-Table query in Access, I wrote the statement in the MS database. The syntax error is returned. The original multi-Table connection query in Access is different.

Table A, B, C, and A are associated with table B and table B with table C. ID keys are used for association.

General Syntax: select * from A inner join B on A. ID = B. ID inner join C on B. ID = C. ID

This statement reports an error in Access. Access has different ways of understanding the SQL syntax. It connects two tables as one table and then connects them with the third table. Therefore, it must be changed

Select * from (A inner join B on A. ID = B. ID) inner join C on B. ID = C. ID

What if there are 4th tables D?

Select * from (A inner join B on. ID = B. ID) inner join C on B. ID = C. ID) inner join D on C. ID = D. ID

......

It can be understood that the operation is always performed between two tables.

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.