Hey Cole,
I think your lack of result may be caused by nulls. Your else statement depends on CoatingsEdge being null, but the where clause requires rating to be equal to CoatingsEdge. And that's the spot: when you ask for something to be tested as equal to a null.
Try this to see the dilemma directly and I'll bet you won't get any of the rows where CostingsEdge and rating are really the same but both null:
Select * from tksii_maincategory where rating = CoatingsEdge
To solve this, maybe a union would work. First get the result set where CoatingsEdge is not null, then union it with the set where it is null. This way you can skip the Case statement, and tailor the where clause as needed by each result set.
Stoney
|