SQL works best with sets of data. My advice is to get the set of largest moons using a SELECT statement and the MAX() function, and then join the result set with the whole table. Then test whether the moon is equal to the largest in order to print 'yes' or 'no'.
Here's an example using MySQL. I created a table Moons containing the columns moonPlanetOrbited, bodyName, moonMeanRadius. The following SQL selects the largest moonMeanRadius for a given moonPlanetOrbited:
SELECT moonPlantedOrbited, MAX(moonMeanRadius) as maxMoonRadius
FROM Moons
GROUP BY moonPlanetOrbitede
Now that we have a list of maxMoonRadius, join the result set with the entire table and test if the moonMeanRadius is equal to the maxMoonRadius:
SELECT m1.moonPlanetOrbited, m2.bodyName,
if(m1.moonMeanRadius = m2.maxMoonRadius, 'Yes', 'No') as Largest
FROM Moons m1
JOIN (
SELECT moonPlanetOrbited, MAX(moonMeanRadius) as maxMoonRadius
FROM Moons
GROUP BY moonPlanetOrbited
) m2
ON m1.moonPlanetOrbited = m2.moonPlanetOrbited;
The IF syntax is from MySQL 5.5:
http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html#function_if
Tested using the following SQL :
CREATE TABLE Moons(
moonPlanetOrbited VARCHAR(255),
bodyName VARCHAR(255),
moonMeanRadius FLOAT
);
INSERT INTO Moons('a', 'b', 1.01);
INSERT INTO Moons('a', 'c', 1.02);
INSERT INTO Moons('a', 'd', 1.03);
INSERT INTO Moons('a', 'e', 1.04);
+-------------------+----------+---------+
| moonPlanetOrbited | bodyName | Largest |
+-------------------+----------+---------+
| a | b | No |
| a | c | No |
| a | d | No |
| a | e | Yes |
+-------------------+----------+---------+
4 rows in set (0.00 sec)