H - try adding a "group by b.zipcode" to the end ...
Dan
Scott Haneda wrote:
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
WHE
> 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(((
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.latit
> Scott, can you expound on what 1 row would be returned, ideally? The
> one with the shortest distance? Or a row with the sums of inc_level1
> ... inc_level7 ?
>
> Looks to me like you're trying to locate all the ZIP codes within a
> given radius of (in this case) ZIP 94949 with the query below
Scott, can you expound on what 1 row would be returned, ideally? The
one with the shortest distance? Or a row with the sums of inc_level1
... inc_level7 ?
Looks to me like you're trying to locate all the ZIP codes within a
given radius of (in this case) ZIP 94949 with the query below. Yes/n