TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Devendra Kumar
NA
517
244.4k
how to use split function with inner join
Jun 20 2016 7:33 AM
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
Reply
Answers (
2
)
Indian Financial year wise Database Design
How to make primary and foreign key of different data types