Join in sql that returns everything

Asked

Viewed 35 times

0

I have two tables, the episodes and episodes seen, I need to make a query that will join the two by the id of the episode, however I do not want the episodes that are not in the second table do not come in the result, I will try to give an example:

Primeira tabela This is the first table

Segunda tabela This is the second table

resultado Putting the two together I want it

If there are any questions left, please ask me. Thank you

1 answer

2


There are several forms of making joins, in your case you have to make a left join, which only considers the records on one side of the table if there is no other, below an illustrative image to be better explained with examples:

inserir a descrição da imagem aqui

  • It worked perfectly, thank you very much!!!

  • nothing :), we need to

Browser other questions tagged

You are not signed in. Login or sign up in order to post.