Help - Search - Members - Calendar
Full Version: Selecting Data From a DB
Pixel2Life Forum > Help Section > PHP, ASP, MySQL, JavaScript and other Web/Database Programming Help
grimcoder
If i wanted to just list all the data in a field by using the select function... is there a way i can do this without it showing duplicates..? like if theres 2 of something it will just show 1
dotbart
I think you're looking for:
CODE
SELECT DISTINCT
derek.sullivan
Can you give us a bit more detail as to what you want? I'm not quite sure I get what you are saying
Tyler2499
You could group....
CODE
Select * from `your_dbtable` GROUP BY yourfield


A basic example of this could be an awards system. Rather than showing every award (including duplicates) it shows the awards but no repeats.
NDBoost
http://www.w3schools.com/SQl/sql_distinct.asp

taken straight from w3s

CODE
SELECT DISTINCT column_name(s) FROM table_name
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.