r/DatabaseHelp • • Aug 16 '17
Every derived table must have its own alias?
SELECT
vl.country_name, vl.count(country_name) as count
FROM
(SELECT
*
FROM
visitor_locations vl
ORDER BY id DESC
LIMIT 1000)
GROUP BY vl.country_nameI just want to get a breakdown of the last 1000 visitors to a site? And I'm not sure how to correct that error?
1
Upvotes
2
u/rbobby Aug 16 '17
Just a quick guess... but your inner select probably needs to be aliased: