I am using the sql query like
SELECT fun_systemuser(UserID) as ConsultantName,
fun_store(UserID) as StoreName,
count(UserID) as No_of_PhoneModel,
PhoneModelID,
(select LeegraRegion
from store
where ID=claim.StoreID) as Region,
fun_network(UserID) as ChannelName,
fun_group(claim.StoreID) as GroupName,
fun_campaigns(UserID) as CampaignName
FROM `claim`
where UserID IN (SELECT id
FROM `systemuser`
WHERE `RoleID`=1
and `Topconsultant`=1)
and StatusID=5
group by UserID ,PhoneModelID
I have query result like given below:
There are 4 records for single consultant with different phone model id and no. of sales of phone model id.
I want to single record for every consultant name and there should be show phone model and no.of phone model with comma separated value.
Ex. single record should display like below
Thomson 4U-Sunnypark 3,2,3,1 1,3,6,9 Pretoria Vodacom Sachar Mobile vodacom Campaigns
Is anybody know what should I use in query so I can get the result as I want. Thanks in advance.