Intersections

Top  Previous  Next

This query is used to create a list of all the distinct intersections in a collision database that locates collisions by intersection. This query is used to populate the Intersections Normalizer.

 

Example query:

SELECT

   St1.Streetname AS Streetname_St1,

   St2.Streetname AS Streetname_St2

 

FROM

    ( dbo.CRASH Crash

      INNER JOIN dbo.STREETS St1 ON ((St1.Streetid=Crash.Street1)))

      INNER JOIN dbo.STREETS St2 ON ((St2.Streetid=Crash.Street2))

 

 

UNION

 

SELECT

   St1.Streetname AS Streetname_St1,

   St2.Streetname AS Streetname_St2

 

FROM

    ( dbo.CRASH Crash

      INNER JOIN dbo.STREETS St1 ON ((St1.Streetid=Crash.Street2)))

      INNER JOIN dbo.STREETS St2 ON ((St2.Streetid=Crash.Street1))

 

In this example the collision database contains no table of intersections. So this query retrieves all of the intersections from all of the collisions in the database.