Column 'languageid' inwhereclauseisambiguous exception

Source: Internet
Author: User
Column 'invalid ageid' inwhereclauseisambiguous error I want to query multiple tables, and this field is used in both tables. the solution on the internet is to add the table name wheretablea in the condition field after WHERE. classid = xxxandtableb. cl Column 'languageid' in where clause is ambiguous error
I want to perform a multi-table query, and the languageid table contains this field. the solution on the internet is to add the table name in the condition field after WHERE.
Where tablea. classid = xxx and tableb. classid = xxx
But because my conditions are the same for tablea and tableb, is it so troublesome to write?

------ Solution --------------------
Of course, you don't have to worry about writing so much. if the judgment conditions are the same, you should try to write down the points. Instead, you don't need to make so many judgments. this has a bad impact on the MySQL engine.
------ Solution --------------------
During table joint query, the same field must be added with the table name or table alias.
The table alias is used in this case.

For example:
Select t1.id, t2.id from table1 as t1, table2 as t2 where t1.id = t2.id
------ Solution --------------------
Differentiate multiple tables.
------ Solution --------------------
You must specify the table from which you want to obtain the languageid.

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.