Page 1 of 1
How to select from multiple rows, and exclude repeats?
Posted: Thu Jun 03, 2004 10:01 am
by bironeb
Im trying to Select from multiple rows in my MySql database and return the results but exclude repeats, then place these results as option values in a select dropdown menu in a forum.
Does anyone have an Idea how I can write the select statement?
Posted: Thu Jun 03, 2004 10:30 am
by magicrobotmonkey
look here for some drop down ideas:
viewtopic.php?t=22329
and try this for a query
Code: Select all
SELECT DISTINCT column1, column2
FROM tablename
WHERE column1 = 'criteria'
Posted: Fri Jun 04, 2004 12:29 am
by kevin7
SELECT * FROM TABLE GROUP BY "colmn"
hmm... i think it's worki too...
Posted: Fri Jun 04, 2004 3:22 am
by patrikG
they keyword is DISTINCT - if you include in your SQL-statement like magicrobotmonkey has shown, you only get unique results.