SQL cheasheet
In same query you can refer to same table twice
select firstname, lastname
from names as a,
names as b
WHERE a.firstname = b.firstname
AND a.lastname != b.lastname
What I learned last week on programming
In same query you can refer to same table twice
select firstname, lastname
from names as a,
names as b
WHERE a.firstname = b.firstname
AND a.lastname != b.lastname