# 2 AS
# 3 SELECT SelectCourse_StudentNo, AVG=AVG (SelectCourse_Score)
# 4 FROM SelectCourse
# 5 GROUP BY (SelectCourse_StudentNo)
# 6 SELECT *
# 7 the FROM V_AVG
# 8 WHERE AVG> 80
# 6 SELECT near a grammar mistakes,
CodePudding user response:
View can contain only one query statements, you this is clearly the two results,Don't feel you should so check?
CREATE VIEW V_AVG
AS
WITH V_AVG
AS (SELECT SelectCourse_StudentNo,
AVG=AVG (SelectCourse_Score)
The FROM SelectCourse
GROUP BY (SelectCourse_StudentNo)
)
SELECT *
The FROM V_AVG
WHERE AVG & gt; 80;
CodePudding user response:
I felt directly from a having clause went, don't need to views,SELECT SelectCourse_StudentNo, AVG=AVG (SelectCourse_Score)
The FROM SelectCourse
GROUP BY (SelectCourse_StudentNo)
HAVING AVG> 80
CodePudding user response:
# 1 the CREATE VIEW V_AVG# 2 AS
# 3 SELECT SelectCourse_StudentNo, AVG=AVG (SelectCourse_Score)
# 4 FROM SelectCourse
# 5 GROUP BY (SelectCourse_StudentNo)
GO - this line and a line GO
# 6 SELECT *
# 7 the FROM V_AVG
# 8 WHERE AVG> 80
CodePudding user response:
Yes, yes yes, but I don't understand WITH V_AVGAS (,,) this format
CodePudding user response:
The