SELECT just one instance from multiple values

  • Hello,

    I want to know if there is a way to select just one time the instance of one or multiple values in one column.

    For instance,

    Table1

    ID - Name

    John

    John

    John

    Charles

    Charles

    Charles

    Todd

    Todd

    Todd

    I want to select the name column but just with a single value for the different values in it like this:

    Name

    John

    Charles

    Todd

    Is it possible?

    Thanks in advance.

  • Yes, it's possible.

    Have a look at "GROUP BY".



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • SELECT name FROM Table1 GROUP BY name;

    or, equivalently...

    SELECT DISTINCT name FROM Table1;

  • Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply