> Scott, I think you want something like this, then, assuming you still > want to limit by radius from a given ZIP. > > SELECT b.zipcode, > sum( b.inc_level1 ), sum( b.inc_level2 ), > FROM zipcodes a, zipcodes b > WHERE a.zipcode = "94949" > AND (3956 * (2 * > ASIN(SQRT(POWER(SIN(((a.latitude-b.latitude)*0.017453293)/2),2) + > COS(a.latitude*0.017453293) * COS(b.latitude*0.017453293) * > POWER(SIN(((a.longitude-b.longitude)*0.017453293)/2),2))))) <= 10
I have been bashing my head on that a bit, right now I get ERROR 1140: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause -- ------------------------------------------------------------- Scott Haneda Tel: 415.898.2602 <http://www.newgeo.com> Novato, CA U.S.A. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]