What use is the "self-join" function in Question#2 in 12th section?


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

https://www.codecademy.com/courses/sql-analyzing-business-metrics/lessons/common-metrics/exercises/1d-retention-ii?action=lesson_resume

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

I just followed the guideline to finish the coding, but do not understand how it works. Could you please help explain? Thanks!

<In this course, it often helps to include a screenshot of your whole web browser – that lets everyone see what you see. If you wish to include a screenshot, add it below this line.>

image
why is the user_id repeated so many times after self join? There are, in fact, no so many items in table “gameplay”. Then what does the repeating user_id indicate?

<If you wish to copy/paste in your code, you can use this next section. This will allow others to copy/paste your code for testing – something that they won’t be able to do with just a screenshot.>

```

select
date(g1.created_at) as dt, g1.user_id

from gameplays as g1
join gameplays as g2 on
g1.user_id = g2.user_id

order by 1

limit 100;

<do not remove the three backticks above>

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.