Solved

Non-repeating results SQL statement

Posted on 2003-11-05
2
347 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now