The point is to group by name
.
If you do not have the same column value,
select
name
, max (address)
, max (phone number)
from customer DB
group by name
I think that would be fine.
If you have the same column value,
select
name
,group_concat(address) as address
, group_concat (phone number) as phone number
from customer DB
group by name
If so, the addresses and phone numbers will be concatenated and output separated by ,
.
© 2024 OneMinuteCode. All rights reserved.