Hello all, I have sql puzzler today.
I have the following sql :
SELECT MemberId,
UnitId,
MaterialLevel,
MaterialText,
ProductPercentage,
ProductPriority
FROM tblWeights
ORDER BY MemberId, MaterialLevel, MaterialText, ProductPercentage DESC
Now, currently the ProductPriority is empty. What I would like to do is update this so that the first product, per level, per materialtext with the highest product percentage with "1", the second highest percentage with "2", etc, etc.
However, when the materialtext changes, this should reset itself and and start again at "1".
Can anyone think how I can do this?