• nandu.chowdary412 (3/10/2014)


    Thank you 4r reply..I got the answer now..I have did same thing before but i have used top in my query..

    the reason for using top query is i want to display top 4 sales amount by prodcutname,country..If i use top in my query it will only giving top 4 out of all countries names..But i want sales top 4 for each country thanks..Please find attached image for more details..thanks

    Images of data are pretty unfriendly. If you want some coded help, please see the first link in my signature line below under "Helpful Links" for how to post data for your question.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)