Mysql - self join to check equality -
i have table structure below.
id, firstname, lastname, address, phoneno
i need select firstnames , lastnames repeated. example,
- 1 bob williams s-oak st 1234567890
- 2 rob williams n-oak st 1235432222
- 3 bob williams s-pec st 4332122111
i need make self join , result bob williams.
no need self-join.
select firstname, lastname, count(*) c table group firstname, lastname having c > 1
Comments
Post a Comment