I have a nvarchar
column which contains values like following:
item1+item2
item1+2item2
4item1+item2+2item3
I want a scalar function to calculate the item count.
As examples above, we notice:
- items separated by "+"
- The item may be have digit in first. This is the item count.
The required count for above examples should be as following:
item1+item2 2
item1+2item2 3
4item1+item2+2item3 7