P
Praxis
Hi all,
I have a SQL query question...
I have a table with road segments that have a low and high address
(see sample QUERY below)
I am wanting to produce a report of the roads that meet the
following...
1. [FROM_ADD] > 0
AND
(
2. the [FROM_ADD] > [TO_ADD]
OR
3. if there is more than one segment with the same name...
the [FROM_ADD] < the previous road segment with the same
name's [TO_ADD]
)
So if I ran it on the query below, I would end up with...
AARONDALE ROAD Because third segment's [FROM_ADD]
is less than the previous
segments [TO_ADD]
There are more errors with
AARONDALE ROAD, but only need to list it once
ABETO STREET Because second segment's [FROM_ADD]
is less than the previous
segments [TO_ADD]
FIRST AVENUE Because the [FROM_ADD] > [TO_ADD]
I hope this makes some kind of sense.
I am needing to go back and research the roads with problems, and we
have 4000+ road segments, so it would take a while to look through all
of them manually.
Thanks for any pointers
Bret
Query result sample (Road Segments with address > 0 and ordered by
[FROM_ADD])
[NAME] [FROM_ADD] [TO_ADD]
AARONDALE ROAD 17800 17900
AARONDALE ROAD 17920 18115
AARONDALE ROAD 18015 18245
AARONDALE ROAD 18115 18215
AARONDALE ROAD 18215 18420
ABETO STREET 3850 3780
ABETO STREET 3850 4070
ABETO STREET 4150 4360
ABRAHAM AVENUE 24900 24970
ABRAHAM AVENUE 24970 25110
ABRAHAM AVENUE 25110 25190
ABRAHAM AVENUE 25190 25250
ACORN DRIVE 16120 16240
ACORN DRIVE 16240 16310
ACORN DRIVE 16310 16383
ACORN DRIVE 16383 16416
ACORN DRIVE 16416 16422
ACORN WAY 23970 24020
ADAMS COURT 20582 20660
ADELLEANA LANE 13300 13350
AIRPORT ROAD 10707 10900
ALAMEDA COURT 14590 14601
ALAMEDA DRIVE 2500 2630
ALAMEDA DRIVE 2630 2707
ALAMEDA DRIVE 2707 2730
FIRST AVENUE 2900 2700
I have a SQL query question...
I have a table with road segments that have a low and high address
(see sample QUERY below)
I am wanting to produce a report of the roads that meet the
following...
1. [FROM_ADD] > 0
AND
(
2. the [FROM_ADD] > [TO_ADD]
OR
3. if there is more than one segment with the same name...
the [FROM_ADD] < the previous road segment with the same
name's [TO_ADD]
)
So if I ran it on the query below, I would end up with...
AARONDALE ROAD Because third segment's [FROM_ADD]
is less than the previous
segments [TO_ADD]
There are more errors with
AARONDALE ROAD, but only need to list it once
ABETO STREET Because second segment's [FROM_ADD]
is less than the previous
segments [TO_ADD]
FIRST AVENUE Because the [FROM_ADD] > [TO_ADD]
I hope this makes some kind of sense.
I am needing to go back and research the roads with problems, and we
have 4000+ road segments, so it would take a while to look through all
of them manually.
Thanks for any pointers
Bret
Query result sample (Road Segments with address > 0 and ordered by
[FROM_ADD])
[NAME] [FROM_ADD] [TO_ADD]
AARONDALE ROAD 17800 17900
AARONDALE ROAD 17920 18115
AARONDALE ROAD 18015 18245
AARONDALE ROAD 18115 18215
AARONDALE ROAD 18215 18420
ABETO STREET 3850 3780
ABETO STREET 3850 4070
ABETO STREET 4150 4360
ABRAHAM AVENUE 24900 24970
ABRAHAM AVENUE 24970 25110
ABRAHAM AVENUE 25110 25190
ABRAHAM AVENUE 25190 25250
ACORN DRIVE 16120 16240
ACORN DRIVE 16240 16310
ACORN DRIVE 16310 16383
ACORN DRIVE 16383 16416
ACORN DRIVE 16416 16422
ACORN WAY 23970 24020
ADAMS COURT 20582 20660
ADELLEANA LANE 13300 13350
AIRPORT ROAD 10707 10900
ALAMEDA COURT 14590 14601
ALAMEDA DRIVE 2500 2630
ALAMEDA DRIVE 2630 2707
ALAMEDA DRIVE 2707 2730
FIRST AVENUE 2900 2700