SQL cheasheet

less than 1 minute read

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

Categories: , ,

Updated:

Leave a Comment