Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Smile Unanswered: Need help a bit(Urgent)

    I have a result set which fetch me Test ID,Module Name,Test Name and few more columns....below is the result

    Test ID Module Name Test Name Attempts
    --------- ---------------- -------------------- ----------
    00009 Sub Process Map Anti Money Laundring 1
    00009 Sub Process Map Anti Money Laundring 2
    00009 Sub Process Map Anti Money Laundring 4
    0000A Fund Transfer(NEFT) Fund Transfer To Account 5
    NULL Accounts Credit Card NULL 6

    According to the test ID i need to find the attempts and the result should look like...

    Test ID Module Name Test Name Attempts
    --------- ---------------- -------------------- ----------
    00009 Sub Process Map Anti Money Laundring 1
    00009 Sub Process Map Anti Money Laundring 2
    00009 Sub Process Map Anti Money Laundring 3
    0000A Fund Transfer(NEFT) Fund Transfer To Account 1
    NULL Accounts Credit Card NULL 1

    Thanks in advance..
    Last edited by Amit120k; 12-20-12 at 07:43. Reason: Tabular data format not appearing properly

  2. #2
    Join Date
    Apr 2012
    Posts
    213
    Try something like this:

    Code:
    select
        TestID,
        ModuleName,
        TestName,
        ROW_NUMBER() OVER(PARTITION BY TestID 
                          ORDER BY Attempts) as NewAttempts
    from MyTable
    Hope this helps.

  3. #3
    Join Date
    Dec 2012
    Posts
    3
    Thanks Dude ..it really worked..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •