Jump to content


Selecting Data From a DB


4 replies to this topic

#1 grimcoder

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 30 October 2009 - 10:58 AM

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

#2 dotbart

    Young Padawan

  • Members
  • Pip
  • 141 posts
  • Gender:Male
  • Location:Diepenbeek
  • Interests:Webdesign, Webdeveloppement, DJ, ...

Posted 30 October 2009 - 01:31 PM

I think you're looking for:
SELECT DISTINCT


#3 derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 341 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 30 October 2009 - 01:50 PM

Can you give us a bit more detail as to what you want? I'm not quite sure I get what you are saying

#4 Tyler2499

    Young Padawan

  • Members
  • Pip
  • 32 posts

Posted 02 November 2009 - 12:27 PM

You could group....
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.

#5 NDBoost

    Young Padawan

  • Members
  • Pip
  • 27 posts
  • Gender:Male
  • Location:Tempe, AZ

Posted 02 November 2009 - 01:24 PM

http://www.w3schools...ql_distinct.asp

taken straight from w3s

SELECT DISTINCT column_name(s) FROM table_name






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users