Selecting Unique Rows

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Selecting Unique Rows

Post by ibanez270dx »

Hi,
Just a quick question. I need to select some information in my database to list out fleet names (which each row has a fleet name), but there are many repetitions. For example, I have three rows for three different airplanes. Two of them are in fleet A and the last in fleet B. Each row is labled which fleet it is in. However, I need to get just the unique fleet names. So when I search that DB, I get back just the names fleet A and fleet B.

any help is appreciated!

Thanks,
- Jeff
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

Code: Select all

SELECT DISTINCT (column_name) FROM ...
Last edited by wtf on Fri Oct 13, 2006 2:38 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

SELECT DISTINCT ...
Last edited by feyd on Fri Oct 13, 2006 3:07 pm, edited 1 time in total.
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Post by ibanez270dx »

Thanks guys!
Post Reply