Multiple SQL Joins error in W3Schools Tryit Editor

0 votes

I'm hoping you can assist me with this little challenging issue. Using the W3Schools SQL course, I'm creating "real-world" queries as I go along to attempt and gain some experience with this. I'm attempting to determine who ordered what using their information by utilising the following:

SELECT c.CustomerName, p.ProductName
FROM Customers c inner join Orders o on c.CustomerID = o.CustomerID
    JOIN OrderDetails od on od.OrderID = o.OrderID
    JOIN Products p on p.ProductID = od.ProductID;

This keeps returning the error:

Syntax error (missing operator) in query expression 'c.customerid = o.customerid join orderdetails od on od.orderid = o.orderid join products p on p.productid = od.productid'.

After much tinkering and having a more knowledgeable colleague review my query, we are unable to identify anything incorrect with what I have typed.

Please give me some assistance or direction.

Sep 17 in Database by Kithuzzz
• 11,640 points
27 views

1 answer to this question.

0 votes

I'm ruining this query on w3school even though it isn't incorrect or returning any errors.http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all

Open this link and paste the query.

    SELECT c.CustomerName, p.ProductName
    FROM Customers c inner join Orders o on c.CustomerID = o.CustomerID
    JOIN OrderDetails od on od.OrderID = o.OrderID
    JOIN Products p on p.ProductID = od.ProductID;
answered Sep 18 by narikkadan
• 19,680 points

Related Questions In Database

0 votes
1 answer

Inserting multiple rows in a single SQL query?

In SQL Server 2008, multiple rows can ...READ MORE

answered Feb 10 in Database by Vaani
• 7,020 points
82 views
0 votes
0 answers

How to ALTER multiple columns at once in SQL Server

ALTER the data types of several columns in ...READ MORE

Aug 12 in Database by Kithuzzz
• 11,640 points
91 views
0 votes
0 answers

How to find sum of multiple columns in a table in SQL Server 2005?

I have a table Emp which has these rows: Emp_cd ...READ MORE

Aug 19 in Database by Kithuzzz
• 11,640 points
89 views
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,980 points
755 views
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 58,080 points
1,396 views
0 votes
1 answer

Using conditional to execute a command in salt

You can use unless inside your state ...READ MORE

answered Jul 23, 2018 in Other DevOps Questions by DareDev
• 6,890 points
820 views
0 votes
1 answer

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008

Solution Go to Start > Programs > Microsoft SQL Server > Enterprise Manager. Right-click the SQL ...READ MORE

answered Sep 12 in Database by narikkadan
• 19,680 points
34 views
0 votes
1 answer

How to delete multiple rows in SQL where id = (x to y)

If you need to delete based on ...READ MORE

answered Sep 17 in Database by narikkadan
• 19,680 points
32 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP