skip to Main Content

I’m getting this error with my code:

SELECT flatpack_ig,FlatpackID ,Name,Colour,Type,UnitPrice,component_ig,ComponentNo, component_ig,
description FROM flatpack_ig
INNER JOIN flatpackcomponent_ig
ON flatpack_ig, FlatpackID= flatpackcomponent_ig,FlatpackID
INNER JOIN component_ig
ON flatpackcomponent_ig, ComponentNo=component_ig,ComponentNo
ORDER BY flatpack_ig,FlatpackID

2

Answers


  1. Chosen as BEST ANSWER

    I think i found the solution not sure

    SELECT flatpack_ig.FlatpackID ,Name,Colour,Type,UnitPrice,component_ig.ComponentNo, component_ig.Description FROM flatpack_ig INNER JOIN flatpackcomponent_ig ON flatpack_ig.FlatpackID= flatpackcomponent_ig.FlatpackID INNER JOIN component_ig ON flatpackcomponent_ig.ComponentNo=component_ig.ComponentNo


  2. Whenever you have multiple tables in a query, you should always qualify all column names. Something like this:

    SELECT fp.FlatpackID, fp.Name, fp.Colour, fp.Type, fp.UnitPrice,
           c.ComponentNo, c.description
    FROM flatpack_ig fp INNER JOIN
         flatpackcomponent_ig fpc
         ON fp.FlatpackID = fpc.FlatpackID INNER JOIN 
         component_ig c INNER JOIN
         flatpackcomponent_ig fpc 
         ON fpc.ComponentNo = c.ComponentNo
    ORDER BY fp.FlatpackID;
    

    I am guessing where the columns come from. My guesses may not be accurate.

    Your query has multiple other problems as well. I am guessing that these are transcription errors — commas instead of periods and misplaced keywords.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search