0
這是我的查詢:如何創建與伯爵SQL視圖()
select
Sales.SaleID,
Sales.StartSaleDate,
Sales.EndSaleDate,
Sales.SalePercent,
COUNT(LessonID) as TotalLesson,
Sales.Status,
Sales.ExpiredStatus,
Sales.SalePrice,
Sales.IsSpecial
FROM
Sales
LEFT JOIN
SaleLessons ON SaleLessons.SaleID = Sales.SaleID
GROUP BY
Sales.Status, Sales.IsSpecial, Sales.StartSaleDate, Sales.EndSaleDate,
Sales.SalePercent, Sales.SaleID, Sales.ExpiredStatus, Sales.SalePrice
ORDER BY
Sales.StartSaleDate DESC
有什麼問題嗎? – McNets
刪除'ORDER BY' – dnoeth
您正在使用哪些DBMS? Postgres的?甲骨文? –