Hi Everyone,
I'm trying to flag only the first record for a street that has a positive latitude value:
update savoy
set flag = 'Y'
where street =
(select distinct street
from savoy
where lat <> 0
and rownum = 1);
The result I would like is this:
STREET LAT LON FLAG
miller st 0.000000 0.000000
miller st 0.000000 0.000000
miller st 41.951319 -70.90576 Y
miller st 41.951400 -70.90580
miller st 41.951425 -70.90640
rabbit ave 0.000000 0.000000
rabbit ave 0.000000 0.000000
orange ave 41.857287 -71.55670 Y
orange ave 41.864087 -71.58000
orange ave 41.867057 -71.58794
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
Instead, I'm getting this:
STREET LAT LON FLAG
miller st 0.000000 0.000000
miller st 0.000000 0.000000
miller st 41.951319 -70.90576 Y
miller st 41.951400 -70.90580 Y
miller st 41.951425 -70.90640 Y
rabbit ave 0.000000 0.000000
rabbit ave 0.000000 0.000000
orange ave 41.857287 -71.55670 Y
orange ave 41.864087 -71.58000 Y
orange ave 41.867057 -71.58794 Y
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
guerney dr 0.000000 0.000000
The latter result flags every instance of orange ave that has a positive LAT -- instead, I only want the first record.
Can anyone tell me what I'm doing wrong?
Many thanks,
oneleaf