• swathi that's a great way to show an alternate solution.

    The only thing that bothers me is that solution only works if there are only 9 categories, 1-9, since you are assuming a single digit category Id;

    As soon as he has more categories than that, he'll need to rewrite it.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!