Reputation: 125
I keep getting this error and I have an alias declared? Any help would be appreciated.
CREATE VIEW maxJokes AS
SELECT MAX(num) FROM
( SELECT J.postUserID, count(*) AS num
FROM JokeTable J WHERE J.date >= '2018-03-01'
GROUP BY J.postUserID
)
Upvotes: 1
Views: 37
Reputation: 37473
you've to add a alias name in the subquery
CREATE VIEW maxJokes AS
SELECT MAX(num) FROM
(
SELECT J.postUserID, count(*) AS num
FROM JokeTable J WHERE J.date >= '2018-03-01'
GROUP BY J.postUserID
)A
Upvotes: 2