Open Sokolan opened 2 months ago
I would like to fix this issue
@Sokolan Hello and thank you for making this issue. Sorry it's taken a while to have it looked at.
If you're still interested in fixing both of these examples, I'd gladly accept a PR that does so :rocket:
Checks
Describe your suggestion
The code snippet provided in the lesson:
Is problematic as
users.name
appear in theSELECT
statement, but it doesn't appear in theGROUP BY
statement, unless we go into specific SQL dialect and dependencies, this isn't allowed (as far as I know) by the SQL standard.Then this snipped:
Using the aliased
posts_written
column in theHAVING
clause, although it's initiated in the SELECT clause. And due to the fact thatHAVING
will be executed before the SELECT it won't "know" about the alias (hence won't work). It also suffers from the same mistake as the previews snippet.There's also a minor mistake of calling
HAVING
a function instead of a clause.note: Those issues appears in both Ruby and Node paths.
Path
Ruby / Rails, Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-databases-databases-and-sql
(Optional) Discord Name
Sokolan
(Optional) Additional Comments
No response