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

Bug in part 3 self-joins #3

Open
SmearingMap opened this issue May 3, 2015 · 1 comment
Open

Bug in part 3 self-joins #3

SmearingMap opened this issue May 3, 2015 · 1 comment

Comments

@SmearingMap
Copy link

In part 3 of the SQLite tutorial, the first command in the self-joins section is broken. Instead, it should be:

SELECT a.last_name, a.first_name, a.amount, b.amount FROM contributors a, contributors b WHERE a.last_name = b.last_name AND a.first_name = b.first_name;

Currently, it is:

SELECT a.last_name, a.first_name, a.amount, b.amount FROM a, b WHERE a.last_name = b.last_name AND a.first_name = b.first_name;

which leaves a and b undefined and results in an error.

PS
I love the tutorial! I've found it very helpful.

@tthibo
Copy link
Owner

tthibo commented May 11, 2015

Hi Mike,

Thanks for this feedback.

The first example in that section is supposed to refer to a situation where the data lives in two separate tables. I updated the text and example to try to make that clearer.

The idea was to introduce the concept of a self join by starting with a join using aliases on two tables. Then we can apply the same concept (joining two aliases for tables) when the two aliases both refer to the same table.

I'll leave this open, in case the changes still haven't made things clear.

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