SELECT COUNT(*) FROM planets WHERE ROUND(SQRT(POWER(('71' - coords_x), 2) + POWER(('97' - coords_y), 2))) <= 17
==> 51
SELECT COUNT(*) FROM planets WHERE ROUND(SQRT(POWER((71 - coords_x), 2) + POWER((97 - coords_y), 2))) <= 17
==> 22
coords_x and coords_y are both TINYINT fields containing values ββin the range [1, 100]. Normally, MySQL doesn't care if the numbers are quoted or not .. but apparently this happens in this case. Question: Why?
source share