i have following tables
tbl_items--> ID,name,price
tbl_customers--> CustId,custname
tbl_sales--> Id,custId,Itemlist,totalprice
I have a proc that stores the record of items bought by each customer in a single row
for eg if customer(custID=1001) buys 3 items(item id 1,2,3) then the record is stored in a single row in tbl_sales as
1~ 1001~ 1,2,3 ~sum of price
now what i want is to show this record like
"customername" ~ "item1,item2,item3" ~ $600.
how can i get this.
i have tried
select cus.name,amt.billamount,(select name form tbl_items where ID in cus.Itemlist)
from tbl_customers cus join tbl_daily_sales_amount amt
on cus.customerId=amt.customerID
an so on.. but i cant get the rdesired output
pls help me with this.