• John Mitchell-245523 - Thursday, December 21, 2017 8:41 AM

    SELECT v.Address
    FROM Vendors v
    LEFT JOIN Cities c ON v.Address = '%' + c.City + '%'

    John

    Important that you understand that with a large number of rows, this will not perform well, because a normal index will not help.   You'd need a FULL TEXT INDEX to be able to get that kind of search to perform better, which would take a rather sizable chunk of disk space and a lot of complexity.   However, if this is a one-time search, then it takes as long as it takes.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)