Solved

Non-repeating results SQL statement

Posted on 2003-11-05
2
354 Views
Last Modified: 2008-01-16
Hey guys,

I know, busy week for me on these boards right? Hehe...anyways.

SELECT pov
FROM TFCC_files
WHERE pov !='' AND pov!='some' AND pov!='some2' AND pov!='some3'
ORDER  BY pov ASC

And it gives me the results I want...well almost (hence the question).

Let's say that in my data there are multiple entries of the same type, so lets say there are 6 values for 'test'. How do I tell MySQL only to give me the unique ones? So instead of returning 6 results for 'test' it will return 1 unique result for 'test'. I need this because this will become a select box and it will look wierd if 'test' repeats itself 6 times.

Thanks in advance.
0
Comment
Question by:drakkarnoir
2 Comments
 
LVL 5

Accepted Solution

by:
arjanh earned 500 total points
ID: 9689726
SELECT DISTINCT pov
FROM TFCC_files
WHERE pov !='' AND pov!='some' AND pov!='some2' AND pov!='some3'
ORDER  BY pov ASC
0
 

Author Comment

by:drakkarnoir
ID: 9691053
Thanks much! Was not aware of that SQL statement DISTINCT.

Rock on :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to display div value on input field value in php 11 55
XML extra information 8 30
Custom Wordpress Loop 22 39
Add Logo to Bookmark and Tab Headings in Browser 3 14
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question