Go to column ' id ' in field list is ambiguous problem

Source: Internet
Author: User

Column ' id ' in field list is ambiguous
This error is because the ID field in your query statement does not indicate which table is the ID field, and it should be distinguished by a table name (or alias).

Examples of distinguishing by table name:
Select Student.id, Student.name, Score.total
From student, score
where student.id = Score.id


Examples of using aliases:
Examples of distinguishing by table name:
Select S.id, S.name, C.total
From student S, score C
where s.id = C.id


Many textbooks are used in a large number of aliases, in fact, for beginners, I suggest that you can read the alias on the line, when you write the table name good


Add: The parameters of the left function must be a field, the completion form of the field is added to the table name, left before the table name will be syntactically wrong, it should be:
Select Left (student.name, 10) .....

Go to column ' id ' in field list is ambiguous problem

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.