MySql: How to display only 1 name only per multiple name -
to make more clear, if have data in mysql:
name | allowance | age ---------------------- khan | 50 | 20 aal | 60 | 22 hyme | 50 | 21 khan | 61 | 20
notice there 2 'khan' in database different allowance. want show name , age if show using mysqli select statement, there 2 'khan' want show 1 'khan'. how can it?
you need use group_concat see agges of khans;
select name, group_concat(age) ages table group name
or minimum aged khan
select name , min(age) miniumage table group name
or elder khan
select name , max(age) maxage table group name
or khan
select name , age table group name
.
Comments
Post a Comment