SQLite Forum

Join Question
Login
One method, (there may be others) is to use sub-selects:

```sql
select
    Support.main as MainKey,
    ( select Name from Names where Names.Key = Support.Main  ) as MainName, 
    Support.Backup as BackKey,
    ( select Name from Names where Names.Key = Support.Backup) as BackName
from Support ;

MainKey     MainName    BackKey     BackName
----------  ----------  ----------  ----------
10          Bob         72          Sally
106         Amanda      73          Jose
```

For symmetry, I've used sub-select for both names; you could leave the `JOIN` in place for one of the names and use a sub-select for the other.