Well, that's another question completely.
The one that fires the longest is the one with more cartridges.
The one that fires the farthest relates to the ballistics...
It would be the one with the highest muzzle velocity and the best ballistic coefficient in flight.
A 9mm Luger cartridge can be designed to fire a subsonic or super sonic load. The speed affects the air resistance it encounters on it's journey.
The bullet weight determines how fast it drops toward earth.
Speed of sound is 1,125 feet per second in dry air.
This chart lists a number of commercial 9mm loads:
http://www.ballistics101.com/9mm.php
__________________

Igitur si vis pacem, para bellum -
- Therefore if you want peace, prepare for war.