select stick,sum(convert(float,weight)) as total
from lod_description group by stick
above query works fine but when null or NA comes in the weight field as data it gives error as varchar to int not allowed
Expected Result:
stick | total
oldstick 10.01
newstick 20.034
Ideally your
weightcolumn should be numeric, and not text. You could sum aCASEexpression which returns 0 in the event thatweightbe a non numeric string.