Viewing 3 posts - 1 through 3 (of 3 total)
When @TxtGrant is NULL, CharIndex should return a NULL value. The comparison > 0 should return false. If you want the comparison to return true when @TxtGrant is NULL...
September 30, 2004 at 8:12 am
I think this will perform better.
SELECT Distinct F.EventID, CauseID
FROM Faults F INNER JOIN (SELECT MAX(Probability) MaxProb, EventID
FROM Faults GROUP BY EventID) MP
ON (MP.MaxProb=F.Probability and MP.EventID=F.EventID)
WHERE CauseID='Banana Peel'
-Karl
September 25, 2004 at 8:55 am
This is clearly a semi-manual process. Consequently, I would not try to solve it in one-fell-swoop.
September 25, 2004 at 8:13 am
Viewing 3 posts - 1 through 3 (of 3 total)