Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed column alias results in error #1

Closed
karl-project-review opened this issue Nov 27, 2018 · 1 comment
Closed

Changed column alias results in error #1

karl-project-review opened this issue Nov 27, 2018 · 1 comment

Comments

@karl-project-review
Copy link

--Question 6 - Query 3 : most common results of the style quiz
SELECT style, count(*) AS total_answers
FROM quiz
GROUP BY style
ORDER BY number_answers DESC;

Note that in the SELECT statement, the count is aliased as total_answers, but in the ORDER BY statement, it is referred to as number_answers instead, resulting in an error. Be careful about using the proper names and avoiding typos like this.

@vibiii
Copy link
Owner

vibiii commented Nov 28, 2018

The query worked so I am pretty sure I have changed the alias when pasting the query on th sql doc but didn't change it everywhere.
Sorry for that

@vibiii vibiii closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants