php - How to select equal values one time from table -
this question has answer here:
- mysql distinct on group_concat() 5 answers
i have table structure this:
|id | country | league | | 0 | germany | b1 | | 1 | germany | b2 | | 2 | italy | |
how can germany once query? this:
germany, italy.
you can this:
select distinct country some_table
this give countries once.
if want country names in single result, can use group_concat()
:
select group_concat(distinct country order country desc separator ',') country_list some_table
Comments
Post a Comment