Hi,
I am taking a database concepts class and I cannot, for the life of me, figure out how to effectively code SQL queries. Every time I run a query I get some sort of error message. I've read other forums on this site about how to fix this issue that I am having, but nothing seems to work. Yes, I have qualified my fields and yes I have every table containing the specific tablename listed... but nothing seems to work. Here is my source code, I hope someone can help me.
Code:
SELECT Customer.CustomerName, Orders.OrderNum, OrderLine.OrderNum, SUM(NumOrdered * QuotedPrice)
FROM Customer, OrderLine, Orders
WHERE Customer.CustomerNum = Orders.CustomerNum
AND Orders.OrderNum = OrderLine.OrderNum
GROUP By CustomerName, OrderNum
When I try to run this query I get an error message that states "The specified field 'OrderNum' could refer to more than one table listed in the FROM clause of your SQL statement." Even though I have qualified my fields and there are only 2 tables (Orders and OrderLine) that has a OrderNum column. Please help me!