I want to find all the rows with the same value in. (Or at least a pair)
I.E.
James| 19.193.283.19
John| 20.134.232.344
Jack| 19.193.283.19
Jonny| 19.193.283.19
I would want it to return rows James, Jack and Jonny -as more than one row has the IP ‘19.193.283.19’ in it.
I tried doing what the other similar question answered:
select *
from `Zombie`
group by `Ip`
having count(*) > 1
order by `Ip` desc
But it just returned 1 row with a pair or more of the similar ‘Ip’ I want every row.
How would I modify the SQL so it returns all indistinct rows?
You could use an
existssubquery to find all rows that have a matching row with the sameIp:Sorting by the number of rows with the same
Ipcan be done with a self-join, like: