Last active
December 31, 2015 01:29
-
-
Save fuzzysteve/7914509 to your computer and use it in GitHub Desktop.
Generate how many stars are within 4.3ly of each system in kspace. (hence the -0.99 restriction)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select solarsystemid,sum(local) from (select mss1.solarsystemid,if(sqrt(pow(mss1.x-mss2.x,2)+pow(mss1.y-mss2.y,2)+pow(mss1.z-mss2.z,2))<4.06802721e16,1,0) local from mapSolarSystems mss1 join mapSolarSystems mss2 on (mss1.solarsystemid != mss2.solarsystemid) where mss1.security!=-0.99 and mss2.security!=-0.99) it group by solarsystemid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment