• LutzM (1/2/2014)


    I don't think a simple DISTINCT will do it since it would return two rows ("Test." and "Test..") where one ("Test") is expected.

    Maybe one of the following approaches will work:

    SELECT DISTINCT (LEFT(yourColumn,4)) FROM yourTable

    SELECT DISTINCT (REPLACE(yourColumn,'.','')) FROM yourTable

    But that's just guessing based on your sample data...

    Dang... I thought the dots were just noise. This is why I wish people would provide data in a readily consumable format.

    @sql-programmers,

    Before you make another post, please see the first link under "Helpful Links" in my signature line below. It helps eliminate confusion and increases the likelihood of you actually getting a correct answer to your problem and fairly quickly, too.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)