![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
Regular Coder ![]() Join Date: Nov 2003
Location: mostly in Ann Arbor
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
return only distinct matches
I have a table with three Keys. riverID (Primary), river name, and state. I want to list all the states that have rivers in them. the following query returns states multiple times, becuase there are multiple rivers in each state.
Code:
SELECT `state` FROM `rivers` If you don't understand my question, please ask for an example. If you do understand my question and know I'm not describing properly, please help me describe it.
__________________
"There is more than one way to do it." |
|
|
|
|
|
PM User | #2 | |
|
Regular Coder ![]() Join Date: Oct 2004
Location: UK
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
SELECT DISTINCT 'field_name'
__________________
Quote:
|
|
|
|
|
|
|
PM User | #4 | |
|
Regular Coder ![]() Join Date: Oct 2004
Location: UK
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Isn't it nice when a language uses a sensible word for a command?
__________________
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|