When I saw this post, I had to try it...
My solution doesn't give numbers, just teams with the same scores. In other words, which teams have the same score as at least one or more teams.
$sql = "SELECT `Team`
FROM `football`
WHERE `TeamID`
IN (
SELECT A.`TeamID`
FROM `football` A, `football` B
WHERE (
A.W = B.W
)
AND (
A.L = B.L
)
AND (
A.`Team` <> B.`Team`
)
)
";
Here's the SQL data schema I used for testing.
CREATE TABLE `football` (
`TeamID` int(10) unsigned NOT NULL auto_increment,
`Team` varchar(20) NOT NULL default '',
`W` int(11) NOT NULL default '0',
`L` int(11) NOT NULL default '0',
PRIMARY KEY (`TeamID`)
) ENGINE=InnoDB;
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (1, 'Bear', 10, 5);
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (2, 'Sea Hawks', 6, 7);
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (3, 'Falcons', 7, 8);
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (4, 'Raider', 23, 1);
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (5, 'Cardinals', 7, 8);
INSERT INTO `football` (`TeamID`, `Team`, `W`, `L`) VALUES (6, 'Chiefs', 7, 8);
This all looks a little goofy to me. I swear I've done stuff like this before...oh well. I posted it in case you could use it.