• fgrubercpa (7/14/2014)


    I have a db of Contacts - it's real simple, NAME, ADDRESS, CITY, ST, ZIP, etc...

    I CAN DO

    SELECT ST

    FROM TABLE

    and I get all of the ST from every record.

    When I try

    SELECT DISTINCT ST

    FROM TABLE

    it displays what looks like a complete listing of DISTINCT CITY values

    but it is UNDER THE COLUMN HEADING 'ST'

    It's like the values next to ST (CITY) has replaced the desired query for some reason,

    any suggestions?

    thx

    Spatio

    Quick questions,

    a. can you post the ddl for the table

    b. what do you get from the following query

    SELECT

    T.ST

    ,ROW_NUMBER() OVER (PARTITION BY T.ST ORDER BY (SELECT NULL)) AS ST_RID

    FROM [schema].

    T