Reputation: 105
I am constructing a view which is supposed to give me the number of students working on any given assignment. Here is what I have so far:
CREATE VIEW v_count AS
SELECT assignment_no, COUNT(*)
FROM assignment WHERE
Upvotes: 0
Views: 36
Reputation: 3013
change your statement to:
CREATE VIEW v_count AS
SELECT assignment_no, COUNT(*) as ct
FROM assignment
group by assignment_no
Upvotes: 1
Reputation: 2208
CREATE OR REPLACE VIEW v_count AS
SELECT assignment_no, COUNT(*) as CountOfStudents
FROM assignment
group by assignment_no
try this..
Upvotes: 1