How to generate serial number in group by sql

I need the query output with record serial number by a group,
Sr No by dept Dept Id Emp Name
========= ===== =======
1 10 aaaaa
1 11 abndddd
2 11 sdfffffff
3 11 s sdfe
4 11 ggg
1 12 dDEWQ
1 13 xccc
2 13 DSAFG
How to generate the first column in the above output using sql?
Thanks in advance
Shrinivas

use the analytic function ROW_NUMBER
here is a small example
SQL> select row_number() over(partition by deptno order by empno) rno, deptno, empno
  2    from emp
  3  /
       RNO     DEPTNO      EMPNO
         1         10       7782
         2         10       7839
         3         10       7934
         1         20       7566
         2         20       7788
         3         20       7876
         4         20       7902
         1         30       7499
         2         30       7521
         3         30       7654
         4         30       7698
       RNO     DEPTNO      EMPNO
         5         30       7844
         6         30       7900
13 rows selected.

Similar Messages

  • How to find serial Number for BCC Plugin?

    Hi,
    How to find serial number for Bcc plugin on FCP?
    I need format my Mac so before that I to find the serial number?
    Please anyone can help me....

    The serial number has the format like E-111-aaa-222-bbb-333-ccc-444-ddd-5ee-ffff, it can be found on a piece of paper which has 3 stickers with it inside the box.

  • How to find serial number on Power Adapeter 12Watt

    how to find serial number on Power Adapeter 12Watt

    You posted in the Older Hardware (prior to 1998) forum.
    Is the the 12W adapter http://store.apple.com/us/product/MD836LL/A/apple-12w-usb-power-adapter ?
    This power adapter is for the new iPad, but it can be used on other Apple iDevices.
     Cheers, Tom

  • How to find serial number to ipod touch if its stolen?

    how to find serial number to ipod touch if its stolen?

    See:
    iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • How to find serial number, how to find serial number

    how to find serial number on Macbook air for registering Applecare?

    Have you looked at the tiny numbers on the middle of the bottom of your MBA?

  • I still use CS3, yes it's true.  Can I some how get a serial number for CS2?b

    I still use CS3, yes it's true.  However, I have my upgrade copy only, not my CS2, and I just purchased a new iMac Mini.  Therefore, I do not have my SN for CS2.  Can I some how get a serial number for CS2?  I found a link with SN's but none worked.  I wo

    There is a SPECIAL serial number for CS2 that will probably not work for a CS3 upgrade http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.htm l
    You may still buy CS6 which has a perpetual license... Premiere Pro to get the bundled Encore Creative Suite 6

  • How to output serial number from production order in GLM ?

    how to pull serial number from production order in wwi template for GLM ?

    Hi,
    Please have a look to this thread:
    BAPI/RFC to get serial numbers for a production order
    Hope it helps,
    Kr,
    m.

  • How to get serial number education version

    how to get serial number would they send to us by email ? since i did not create an account when i submited my application

    Find a serial number
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • Need to know how to get serial number to ipod that i only have receipt on

    Need to know how to get serial number to ipod that i only have a receipt on

    How to find the serial number of your Apple hardware product

  • How to generate Serial numbers using JAVA SCRIPT

    how to generate serial numbers(incrementing by 1) using JAVA SCRIPT
    thanking you,
    pola pradeep

    i am afraid that whether ur looking for this. bcoz its a simple for loop
    <script language="JavaScript">
    //count = limit value for u
    for(i=0;i<count;++i){
         alert(i);
    </script>
    or if ur looking for something else, pls mention ur requrment precisely
    aleena

  • How to generate a  number sequence for a column of a Z*table?

    Hi ,
    How to generate a  number sequence for a column of a Z*table?
    plz guide me.
    thanks
    Albert

    1) Use SNRO for defining a number range.
    2) Use FM NUMBER_GET_NEXT for getting the next number with object, sub object etc..
    See one example below.
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr                   = c_01
              object                        = c_z_prd_code
    *           QUANTITY                      = '1'
             subobject                     = p_vkorg
    *           TOYEAR                        = '0000'
    *           IGNORE_BUFFER                 = ' '
           IMPORTING
             number                        = in_prd_code
    *           QUANTITY                      =
    *           RETURNCODE                    =
            EXCEPTIONS
                  interval_not_found            = 1
                  number_range_not_intern       = 2
                  object_not_found              = 3
                  quantity_is_0                 = 4
                  quantity_is_not_1             = 5
                  interval_overflow             = 6
                  buffer_overflow               = 7
                  OTHERS                        = 8
    3) You may write these code in main program of the table maintinence
    rgds,
    TM.

  • How to generate BP number for the employee (ECC to CRM) ...

    Hi all,
    can any one give solution for ,how to generate BP number for the employee from ECC to CRM other than active status,as i downloaded employee data from ECC to CRM through ALE/IDOC,as only active employment status employees are got BP number generated,remaining also transfered to CRM but BP number is not generated for those employees,these employee records i can able to see in the HRP5580- HRP5587 tables.
    thanks in advance.
    vamshi.
    Message was edited by:
            vamshidher rao

    Hi,
    Or are you looking for this:
    SELECT serial_number, paaf.assignment_number
    FROM pay_assignment_actions paa, per_all_assignments_f paaf
    WHERE action_status = 'C'
    AND paaf.assignment_id = paa.assignment_id
    AND serial_number IS NOT NULL
    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date;
    - Viky
    Edited by: Viky on Dec 17, 2010 11:42 AM

  • HT3396 how to buy serial number for iwork

    how to buy serial number for iwork

    I'm sure the problem is that you have the trial of iWork '09 installed. It's a "giitch" in the installer code that Apple has not fixed. You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
    Yvan Koenig has written an AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip.

  • How will my serial number work?

    Please, how will my serial number work?

    Did you register it with Apple? If not, you would have had to write it down. Once the device goes out of wifi or if the thief turns wifi off...its gone. All they have to do is restore it as new, you wont be able to detect it again. Sounds bleak I know but its hard to get it back once its gone...no matter what Apple says.
    I really hope it turns up...I hate thiefs. Best of luck.

  • How to generate Serial(Unique) Number for finished goods?

    Guru's,
    How do i generate Serial(Unique) Numbers for finished goods.Suppose,if we get an order for a finished good A of 10 qty.We want to generate unique number to identify each and every A item separately for quality purpose.Any help is much appreciated.
    thanks Guru's

    Depending on serial control of item, you will need to generate serial numbers at the time of WIP Completion transaction using Serial Entry window (i.e. if serial control is At Receipt) or at the time of job creation (i.e. if you are using serial control as predefined)
    In latter case, you will have to use MES or MSCA screens to perform serialized WIP completion.
    Thanks,
    Hrishi

Maybe you are looking for

  • TS4006 how can i find my stolen imac i do have cloud id

    how can i find my stolen imac ? i do have cloud id.

  • Column order in Mail (or From column won't stick)

    Not my first post about this, but thought I'd try again. Back in January I was asking if anyone else had the issue where the From column just won't stay on the left side. I like From, Subject, Date, To. But one way or another, the From column jumps o

  • IP confusion in Convergence

    Hello, I just completed a single-host installation of CommSuite 7 (on Solaris 10 x86) and I seem to have put myself into a bind (nothing new there!). I have customers that need access to my server from behind firewalls with immutable configurations (

  • I'm having trouble with ABS kernel build

    I built a kernel, as per https://wiki.archlinux.org/index.php/Cu - n_with_ABS .  It seemed pretty straight forward. The goal was to set CONFIG_PREEMPT=n so I could compile and native install ZFS.  I managed to get the kernel compiled and installed wi

  • Mark(highlight, bold, and so on) text in GWT (for help)

    I want to display a paragraph text in GWT, in some component(TextArea, or RichTextArea...), and then double-click the words in the text to select them. Now I want to highlight the words, can GWT support that effects I need? I have tried to use TextAr