Solved

Non-repeating results SQL statement

Posted on 2003-11-05
2
346 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
Comment Utility
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
Comment Utility
Thanks much! Was not aware of that SQL statement DISTINCT.

Rock on :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 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

10 Experts available now in Live!

Get 1:1 Help Now