Calculate Sum of comma separated value from columns in SQL Server

Last Reply one year ago By dharmendr

Posted one year ago

Hi! I have two table in sql with data. But I want multiple number with price and show summa.

Id

Name

Price

1

Apple

5

2

Orange

13

3

Oil

25

4

Cherry

12

 

Id

Person

IdFood

NumberKg

1

Rustam

1,3,4

2,3,1

2

Sadriddin

2,3,1,4

1,1,1,1

3

Nurullo

4

3

For example:

Apple id=1 and price=5, number=2, price multiple number =10

Orange id=2 and price=13, number=3, price multiple number =39

Cherry id=4 and price=12, number=1, price multiple number =12

summa =61 only for Rustam. Its need for all person.

This question does not have replies that have been liked.