SQL Command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Beany
    New Member
    • Nov 2006
    • 173

    SQL Command

    Hi,

    i have a combobox that shows a list of providers...... .........

    in this list there are duplicates... for example

    1.BT
    2.CABLE
    3.BT
    4.BT

    so there are three BT's.......

    is there an SQL statement that i can use that will only show BT once?
    anyone know this SQL?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You can establish that by using the GROUP BY attribute, as in
    [php]SELECT provider FROM table_name ORDER BY provider GROUP BY provider[/php]
    (ORDER BY sorts the list of providers)

    Ronald :cool:

    Comment

    • prileep
      New Member
      • Jan 2007
      • 20

      #3
      SELECT distinct provider FROM table_name

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by prileep
        SELECT distinct provider FROM table_name
        You are right of course! What was I thinking?

        Ronald :cool:

        Comment

        Working...