• sudhirnune (4/9/2013)


    I will try to Explain you the Scenario and need Suggestion:

    1. I have te table which is Similar to TEST_SRC for which will tipically has 4000 to 5000 Payment types, along with the County.

    2. I need has a TEST_FORMULA which will be having Country.

    3. We need to generate the data which will have the Payment Types as columns.

    4. We need to now Update Couple of Column based on the Formula defined in the TEST_FORMULA.

    Please need your help to guidance, which will be help to understand the process / Procedure whcih will help to achive the Above Steps

    Here's what I recommend you do. While you only have one calculation one test case with 3 calculations, write one query to deal with it - similar to or the same as the one I've written for you above. Continue to write queries for new cases until you have five or six test cases with different sets of columns and different calculations, at which point you will also have a representative sample set of data and queries to post here.

    This approach will provide you with a far more clear picture of the whole process, and will also provide us with sample data and calculations to build a robust solution for you.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden