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

Page 152, the ORDER BY in window function does not make sense #6

Closed
shepard8 opened this issue Nov 16, 2020 · 1 comment
Closed

Page 152, the ORDER BY in window function does not make sense #6

shepard8 opened this issue Nov 16, 2020 · 1 comment

Comments

@shepard8
Copy link
Contributor

Hello dear authors,

This is not an error stricto sensu, but on page 152, in the following query:

select category, row_number() over w, title, last_value(title) over w
from posts WINDOW w as (partition by category order by category) order by category;

The first order by category does not make sense. I believe putting it in the erratum or updating the query in the code of chapter 5 would mislead the reader, but maybe you want to note this somewhere for a future second edition?

I guess your initial intent was to put order by title there.

@sscotty71
Copy link
Collaborator

Hello sheparrd8,
Thanks for reporting, it was a transcription error, originally it was

select category, row_number () over w, title, last_value (title) over w
from posts WINDOW w as (partition by category order by title) order by category;

so that the row_number () was tied to the title.

Thanks again for your help
Enrico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants