Hi all,
I know this isn't exactly PHP but I was wondering if there's a simple MySQL query you can use to get back non-distinct lines... like for example you can use SELECT DISTINCT to only give you back the rows with that unique value in a field or whatever... but I'm looking to do the opposite.. I can filter the data with PHP if needs be but I'd much prefer to only get the correct data from the SQL instead and leave unneeded programming out of it...
I have a field called mac address on my DB and there are duplicate items and I simply want to be able to pull up details for the mac addresses that are reported twice so I can remove old data from the DB....
for example, if I wanted to get back unique mac addresses on the DB only I would do this:
$sql = "SELECT DISTINCT `primarymac` FROM `aidahardware` ORDER BY 'datestamp' DESC";
$result = mysql_query($sql) or die(mysql_error());
but how do I do the exact opposite??
Any help is much appreciated as I cannot find the answer I'm looking for through google etc.