Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:48:20+00:00 2026-05-26T00:48:20+00:00

I have this messy join query using 3 tables: SELECT p.idproduct, p.name, m.sust, p.desc,

  • 0

I have this messy join query using 3 tables:

SELECT p.idproduct, p.name, m.sust, p.desc, pp.p_v
FROM products As p
LEFT JOIN meds As m ON m.idproduct = p.idproduct
NATURAL JOIN products_prices As pp
INNER JOIN suc_products As sp ON sp.idsuc = 'SUC1' AND sp.idproduct = p.idproduct
WHERE p.bars = '1';

I get this error:

Error Code: 1052. Column 'idproduct' in from clause is ambiguous

Need help, please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:48:21+00:00Added an answer on May 26, 2026 at 12:48 am

    Here’s a wild guess: your product_prices table has an idproduct column and MySQL is complaining that it doesn’t know if it should use m.idproduct or p.idproduct for the join.

    Try changing the NATURAL JOIN to an INNER JOIN with an explicit ON condition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this hql query, which works perfect: select m from Media m join
I have this query: SELECT course_category.id AS languageId, course_category.code AS languageCode, course_category.name AS languageName,
I currently have quite a messy query, which joins data from multiple tables involving
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
If I have a query/results set as follows... from t1 in table1 join t2
I have the following query: SELECT tableOneId SUM(a+b+c) AS tableOneData, MIN(d) AS tableTwoData, FROM
I have this: var field = query(form#+form.id+ input[name=' + error.field + ']); if(field.length){ if(
I have an app that is built from Flash CS5.5, exported using AIR3.1 and
i have a pretty messy query, i would like to know if there is
I don't know if I've made this messy or not...... I have an MDI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.