2017-03-20 3 views
0
select OD.orderID, C.CustomerName, O.OrderDate,   
    round(sum(P.Price*OD.Quantity)) as TotalPrice 
inner join OrderDetails as OD on OD.OrderID=O.OrderID 
inner join Products as P on OD.ProductID=P.ProductID 
inner join Customers as C on O.CustomerID=C.CustomerID 
group by OD.OrderID 
Order by TotalPrice 
limit 5 

Hier ist meine SQL-Anweisung. Es gibt mir 'inneren' Syntaxfehler ... Kann ich fragen, was das Problem ist?SQL ERROR "1 nahe 'inner', Syntaxfehler" W3C-Beispieldatenbank

Antwort

5

Ihre SQL-Anweisung fehlt die FROM Klausel:

select OD.orderID, C.CustomerName, O.OrderDate,   
    round(sum(P.Price*OD.Quantity)) as TotalPrice 
FROM <your driving table here> 
inner ... 

Vermutlich wollen Sie von Orders wählen:

select OD.orderID, C.CustomerName, O.OrderDate,   
    round(sum(P.Price*OD.Quantity)) as TotalPrice 
FROM Orders as O 
inner ... 
+0

Ah richtig, wir danken für das anzeigt, dass, mein schlecht. –