0

I am still learning how to use self-joins.

I would like to find out if somebody has multiple accounts by querying the same id. My understanding of self join is the following:

select, 
a.account_number, 
a.person_id, 
b.person_id 
from table a
inner join table b
on a.person_id = b.person_id

But it is bringing back the person_id twice but not showing me if there are different accounts.

Can I have some guidance please?

Many Thanks, JB

JB78
  • 41
  • 1
  • 1
  • 5

0 Answers0