2
Answers

how to use split function with inner join

hello friend please help :
 
i will create a function for split then i want to use this function in another query  with inner join  but how to solve this query any method
 
SELECT *, b.Price,c.Qty,b.Price_Updated_by,tbl_size.size_id, tbl_size.name, a.Category_Name,
when b.Price_Updated_by = 'Product' then b.Price*c.Qty else a.cat_price*c.Qty end as[TotalPrice],
case when b.Price_Updated_by = 'Product' then b.Price else a.cat_price end as[amountValue]
,ROW_NUMBER() over (ORDER BY B.ProductId) AS itemCount,
c.Qty[quantityValue]
FROM Tbl_Products b
cross apply dbo.split(b.sizeid,',') split
INNER JOIN tbl_size ON tbl_size.size_id = split.val
inner join Tbl_Category a on a.Category_Id= b.Category_fkid
inner join dbo.Tbl_MyCart c on b.ProductId=c.Product_Fkid
where c.SessionId='wrdme1yfvdy4zew4viliz2rj'
 
 
 i want to  
cross apply dbo.split(b.sizeid,',') split this query with inner join how get it 
 
Answers (2)