• Thanks for the info. Maybe this will clarify:

    My ultimate goal is to only find the distinct combination of two addresses in this table.  (Regardless of the passenger or TripID or whether the addresses show up as outbound trip or return trip.)

    I tried concatenating ((PAddress + ' ' + DAddress) [Trip]) to make a new column ("Trip") which should have distinct values but that doesn't help me to narrow down things as it will of course still show two records for each "trip" between two addresses.  I only want to see one.
    Here's some sample data: (sorry for the weird format spacing, not sure what's going on here)

    CREATE TABLE #TRIPS


    (TRIPID INT


    ,PICKUP_ADDRESS VARCHAR(50)


    ,DROPOFF_ADDRESS VARCHAR(50)


    )


    INSERT INTO #TRIPS


    VALUES

    (23084416


    ,'100 MELROSE AVE E'


    ,'915 NW 45TH ST')


    INSERT INTO #TRIPS


    VALUES

    (23079056


    ,'1001 5TH AVE'


    ,'18100 NE 95TH ST')


    INSERT INTO #TRIPS


    VALUES

    (23084870


    ,'3252 64TH AVE SW'


    ,'1524 S 328TH ST')


    INSERT INTO #TRIPS


    VALUES

    (23059443


    ,'915 NW 45TH ST'


    ,'100 MELROSE AVE E')


    INSERT INTO #TRIPS


    VALUES

    (23081731


    ,'7100 CALIFORNIA AVE SW'


    ,'1001 5TH AVE')


    INSERT INTO #TRIPS


    VALUES

    (23086885


    ,'18100 NE 95TH ST'


    ,'1001 5TH AVE')


    INSERT INTO #TRIPS


    VALUES

    (23064853


    ,'1524 S 328TH ST'


    ,'3252 64TH AVE SW')


    INSERT INTO #TRIPS


    VALUES

    (23084523


    ,'1001 5TH AVE'


    ,'7100 CALIFORNIA AVE SW')


    SELECT *


    FROM #TRIPS


    DROP TABLE #TRIPS

     

    What I'm hoping to get as the resultset is something like this:

    CREATE TABLE #EXPECTEDRESULTS


    (PICKUP_ADDRESS VARCHAR(50)


    ,DROPOFF_ADDRESS VARCHAR(50)


    )


    INSERT INTO #EXPECTEDRESULTS


    VALUES

    ('1001 5TH AVE'


    ,'7100 CALIFORNIA AVE SW')


    INSERT INTO #EXPECTEDRESULTS


    VALUES

    ('100 MELROSE AVE E'


    ,'915 NW 45TH ST')


    INSERT INTO #EXPECTEDRESULTS


    VALUES

    ('1001 5TH AVE'


    ,'18100 NE 95TH ST')


    INSERT INTO #EXPECTEDRESULTS


    VALUES

    ('3252 64TH AVE SW'


    ,'1524 S 328TH ST')

    Notice that doesn't return every combination of the addresses, since most of these have two (outbound and return).
    Does that make more sense?