How to get lines with English letters at the end of race

Hi all

Examples of data include:
create table test_app(application_no number, net_code number,branch varchar2(40));

insert into test_app values(1001,01,'operations')
insert into test_app values(1001,02,'production');
insert into test_app values(1001,03,'testing')
insert into test_app values(1002,01,'power coding');
insert into test_app values(1002,02,'testing')
insert into test_app values(1002,03,'export');
insert into test_app values(1002,03,'operations');
SQL> select*from test_app
  2  where application_no=1001;

APPLICATION_NO   NET_CODE BRANCH
-------------- ---------- -----------
          1001          1 operations
          1001          2 production
          1001          3 testing
  1  select*from test_app
  2* where application_no=1002
SQL> 

APPLICATION_NO   NET_CODE BRANCH
-------------- ---------- --------------
          1002          1 power coding
          1002          2 testing
          1002          3 export
          1002          3 operations
But my real need is delivered as follows:

If an application having more then a result lines then
I must add A, B, C, D... up to the total number of rows in the result set.
Surely it will not exceed more then 26 ranks (will not exceed 'Z');



the result should is:

ask any = 1001

DIRECTORATE GENERAL OF THE NET_CODE OF THE APPLICATION_NO
-------------- ---------- -----------
1001 operations 1
2-1001 production_A
1001 3 testing_B


ask any = 1002


DIRECTORATE GENERAL OF THE NET_CODE OF THE APPLICATION_NO
-------------- ---------- --------------
1002 1 power coding
1002 2 testing_A
3 1002 export_B
3 1002 operations_C

If we have 10 lines to the appication = 1002;



DIRECTORATE GENERAL OF THE NET_CODE OF THE APPLICATION_NO
-------------- ---------- --------------
1002 1 power coding
1002 2 testing_A
3 1002 export_B
3 1002 operations_C
.... ..........._I

Note: first line should add with no letters. Add letters with the second row.

How to achieve this result. Please help me...

Published by: roots on 6 March 2012 09:14
select  application_no,
        net_code,
        branch ||
        case
          when row_number() over(partition by application_no order by net_code,branch) > 1
            then '_' || chr(ascii('A') + row_number() over(partition by application_no order by net_code,branch) - 2)
        end branch
  from  test_app
  order by application_no,
           net_code,
           branch
/

APPLICATION_NO   NET_CODE BRANCH
-------------- ---------- -----------------
          1001          1 operations
          1001          2 production_A
          1001          3 testing_B
          1002          1 power coding
          1002          2 testing_A
          1002          3 export_B
          1002          3 operations_C

7 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • How to get help with conversion ROCK on the export of PDF?

    How can I get help with the quality of the PDF documents converted to word format export.

    Not likely to have, you're doing a "happy dance" but a scanned image is "the ear of the sow" and (Yes, I'll say).

    You can't have a scholarship of silk in one ear of the sow.

    Make you a picture of the text content. You get a result of OCR of all that is recognized. The character by character recognition accuracy is generally quite good. But - No image/photo file actually holds information on format, layout, fonts, etc. - it's just a picture. Acrobat OCR makes some assumptions about all this.

    -You have a bunch of each of the characters being exported to Word. Individual characters, not paragraphs, sentences no, no words, no values "white space", etc.

    So you get an export that is a "best estimate" of the less desirable source. Sometimes, it isn't so bad. Sometimes it's just awful. In all cases, you will need to do some cleanup of the exported content that landed in the Word file.

    The alternative is to transcribe the hardcopy to the Word file.
    In fact it can often be higher as a workflow rather than the scanning-ocr-export-cleanup shuffle

    .

    For really nice export "spot - we ', you must start with a PDF file from an application of creation (not a scanned image) which is a well-formed tag PDF (for example ISO 14289-1, PDF/UA-1).
    The purpose of the tagged PDF document is not only Accessible PDF is also how PDF supports actively the re-use of content (for example, export).

    Be well...

  • How to get line numbers to display on the SQL worksheet?

    Dear Forum,

    I learn the SQL Developer.  I use it in my work and school.  At school, when I enter a query in the SQL worksheet, line numbers show in a column to the left of the editing area.  In my work, no line number.  I'm working on a fairly long query at my work, and the line numbers would be useful.

    I looked at tools / preferences / settings for the Code Editor, but do not find a setting for line numbers.  I looked at the other tabs in preferences and found nothing that looked useful.

    I have looked at all of the choices on the display list, but can't find anything on line numbers.

    Am I missing something obvious?  Line numbers is also available?  If so, how?

    I looked at various hits "line number" in this forum, but I've not found anything exactly the point.

    Beverly

    PS Oracle 11g, SQL Developer 3.0.04, Linux x 86-64 (don't have version)

    Tools-> preferences /-> Code Editor-> line gutter

  • My facebook language has been replaced by the English to Spanish... How to get back to English?

    My facebook language has been replaced by the English to Spanish... How to get back to English?

    This problem has nothing to do with Apple products except for the material you listed

  • How to get out with renaming a file every time that I change it?

    How to get out with renaming a file every time that I change it?

    Since the last update, I have more the possibility to combine files. How can I recover this feature

    10 pro version

    For the first issue: disable the preview pane in Windows Explorer.

    Wednesday, July 15, 2015 to 18:46, keithf52379832 [email protected]>

  • Accidentally, I bought the Mac in December and contacted support which helped me to get the right version installed, but now the PC version is not in my account downloads and I need to add it to a new computer. I don't know how to get help with this.

    Accidentally, I bought the Mac in December and contacted support which helped me to get the right version installed, but now the PC version is not in my account downloads and I need to add it to a new computer. I don't know how to get help with this. I don't remember how I got the PC version, I think I have access to my computer remotely and she sent, but I can't find any record of it.

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • cc of Photoshop, Danish, how I get to an English version?

    cc of Photoshop, Danish, how I get to an English version?

    http://helpx.Adobe.com/creative-cloud/KB/change-installed-language.html

  • How to display prices with which we won the most?

    Hello guys!

    I try to learn a few new skills in oracle sql if I was looking for examples on the web. I found this one, with 6 questions. I did all the tables and all the connections. I knew solve 5 questions but that, finally one seems too difficult for me.

    I don't know how to display tables with which we won the most. We do need to check what Denis is rendered which course and anyone who paid that invoice, what kind of prices was also on this Bill (normal od student).

    I would be really happy if you guys could help me.

    Thank you very much!

    Here is the printscreen of my E-R model and my oracle sql code:

    http://imgur.com/oM5IbTL,
    http://pastebin.com/c1CqF3K8

    If you don't understand anything, despite my bad English or anythning else, feel free to ask. I would be really happy if we could solve this problem!

    As far as I know, bill and section have no impact on this problem.  As Frank said, this looks like a Top - N type problem.  You is a way to get answer:

    dev1 > select gains, num_students, lesson_name, course_name

    2 from (select course_name, lesson_name, num_students, gains,

    3 dense_rank() ON rn (salary desc order)

    4 of (select c.name course_name, l.lesson_name,)

    5 count (vr.id) num_students,

    6 sum recipes (p.price)

    7 of course c

    8 Join Conference l

    9 l.fk_course = c.id

    Join the 10 visit vg

    11 on l.id = vg.fk_lecture

    join 12 visitor RV

    13 on vg.fk_visitor = vr.id

    price of 14 p join

    15 p.fk_course = c.id

    Group 16 by c.name, l.lesson_name))

    where the 17 rn = 1;

    LESSON_NAME NUM_STUDENTS PROFIT COURSE_NAME

    ------------------ --------------------- ------------ ----------

    C++, programming 3 750 programming

    Java programming programming 3 750

    If you really don't want that one line returned with a tie, then you replace dense_rank, row_number or do something like:

    Select course_name, lesson_name, num_students, recipes

    from (select c.name course_name, l.lesson_name,)

    Count (VR.ID) num_students,

    Sum revenue (p.Price)

    of course c

    join the l Conference

    on l.fk_course = c.id

    Join visit vg

    on vg.fk_lecture = l.id

    Join the vr visitor

    On vg.fk_visitor = vr.id

    Join the price p

    on p.fk_course = c.id

    C.name group, l.lesson_name

    order by 4 desc)

    where rownum = 1;

    This structure returns a single line in the case of links, but there is no way to predict which of the related rows will be returned.

    John

  • Had to reformat my hard drive, now when I try to reinstall Windows XP I get a blue screen with this code at the end 0x0000007b.

    has had to reformat my hard drive now when he star0x0000007b (0x78d663c, 0xc0000034, 0x00000000, 0x00000000)

    has had to reformat my hard drive, now when I try to reinstall windows xp, I get a blue screen with this code at the end 0x0000007b (0x78d663c, 0xc0000034, 0x00000000, 0x00000000) how to solve this problem

    Hello

    I saw the 0x0000007B BSOD caused by trying to install XP on a disk hard while the BIOS is designating the reader as AHCI instead of IDE. XP has no native AHCI drivers, resulting in a stop 7B. Unless the PC had originally Vista or Win 7, but it might be useful to check that it is not likely.

    If the BIOS is set to AHCI, you could do one of three things (depending on whether your PC has a floppy drive)...

    1 find the Setup F6 disk on AHCI support at installation time (start with the manufacturer's website if you do not already have such a thing). Watch the very hit F6 prompt early in the installation process.

    2. change the setting in BIOS on IDE / ATA

    3. create a new "slipstreaming" installation disc drivers AHCI in the existing installation disc, see http://www.nliteos.com/index.html

    After the back if your BIOS is IDE / ATA

    Tricky

  • Re: Font book. I chose "restore standard fonts" by mistake. How to get back on my choice. The Cancel button is grayed out so I can't cancel it. Any suggestions? Thank you!

    Re: Font book.

    I chose "restore standard fonts" by mistake. How to get back on my selection. The Cancel button is grayed out so I can't cancel it. Any suggestions? Thanks in advance!

    If you click on 'Restore the standard fonts', fonts that are not included in the OS X systems is placed in a "fonts folder (deleted) next to the fonts folder.

    / Library/Fonts

  • Everytime I open a new window or refresh a getting started with firefox page opens with her. So, whenever I go to my homepage for example getting started with firefox opens along the coast in a separate tab.

    Everytime I open a new window or refresh a getting started with firefox page opens with her. So, whenever I go to my homepage for example getting started with firefox opens along the coast in a separate tab.

    This has happened

    Each time Firefox opened

    == I have this computer.

    You are welcome

  • My deskjet 3522 print horizontal lines with no printing on the lines

    My deskjet 3522 print horizontal lines with no printing on the lines

    I solved prolem with horizontal lines with no printing on the printer cleaning lines and lining up and will leave no paper in the tray to dust cllect

  • How to open photoshop with tools window around the screen?

    How to open photoshop with tools window around the screen?

    Try this:

    I hope this helps!

    Julia

  • Installer of Lexmark printer drivers saved in a folder "c:\Program Files \" (with a space at the end of this one!)

    I have a real problem.

    On my Windows 7 Professional machine somehow is an automatic update of installed Lexmark printer drivers and the installation program saved files
    in a folder names "c:\Program Files \" (with a space at the end of this one!)

    This all happened the day after without seeing me what was going on.

    It seems that the Windows 7 system does not like the folder or file names ending in a 'space' or a 'period' and it will not work with it.

    The side effect is that in some sort the system has copied EACH name on this new folder called sub0folder "C:\Program Files-" and I ended up with TWO files that have the air of the same name (even if we have a space at the edn of it ".

    It isn't really a problem in what I could simply ignore it (the other folder names corrrectly operates always OK). The only problem is that changes to 'Security' affect the TWO files because Windows 7 sees the two folder as the 'same' names when setting security.

    That's why, when I tried to mark the 'bogus' as 'not available' folder to everyone (including the system) it is the same for 'Program Files' (the real one) with disastrous consequences. I had the chance to get out and restore some semb; launched sound mind to my machine.

    But I'm stuck now with this annoying issue with many sub-fdolers (which are all unaccessable because the system cannot locate).

    My question is, how to remove a file that has a 'space' as the last part of his name when Windows Explorer cannot work with it?

    Thanks a lot with no matter what helpf with this very unusual problem.

    If you have the opportunity to make a complete picture of the system of the disc, I would before you try the following... just in case remove the "bad" folder ends up deleting all good also.  Alternatively, rather than remove the directory in the last step below, rename it using a command like

    ren c:\PROGRA~3 c:\badprogs {press Enter}

    If program of the 'real' the files and other directories survive unscathed, and then delete the C:\badprogs in the usual way.

    ******************************************

    In the search box, type cmd, then right click on cmd.exe and select "Run as Administrator".  Give the password when you are prompted.

    Type

    CD c:\  {Press Enter}

    to switch to the root

    Now type

    dir /x {press Enter}

    This will show you a list of directories of names "short form".  You will probably see something like this (from a x 64 Win 7 installation, is why there "Progra ~ 1" and "Progra ~ 2" directories ")

    Directory of c:\

    01/08/2012 13:19

    PROGRA ~ 1 Program Files
    30/07/2012 13:03 PROGRA ~ 2 Program Files (x 86)
    03/07/2012 10:46 users
    30/07/2012 20:16 Windows

    In your case, your directory parasite called or PROGRA ~ 3 (if you have x 64) or PROGRA ~ 2 (if you have Windows 7 32 bit).

    Now that you know the name short, which allows to delete:

    del C:\progra~3 {press Enter}

  • How can I keep a visible image at the end of the EP 13?

    When my videos ends EP 13, it becomes black. How can I keep a visible image at the end?

    crimpers

    So far my YouTube video playback are all ending with the game again screen with a bunch of photos to the videos that are not mine.

    I explore the concept of thumbnails of video in YouTube.

    Video thumbnails - YouTube help

    Which seems to imply that what you see before the play button is hit.

    I found the following

    How to pause youtube video embedded on the last picture? -Stack overflow

    But, still trying to understand how they actually follow through on the details of the discussion.

    RTA

Maybe you are looking for

  • Unable to connect to FaceTime or iMessage

    New iPad Air 2 62 GB tried to sign in FaceTime and iMessage and get message "failure to break." However, wifi is on and all other applications work. iCloud works as well.

  • Why firefox5 couldn't google toolbar?

    When I use google toolbar firefox4 works after that upgrade to firefox5 google toolbar cannot be used.

  • Static IP address assignment to a device? (An XBox)

    I'm trying to set up my XBox One to broadcast remote but I am completely ignorant when it comes to networking and rely the economy on the default settings. There seem to be three main parts to this process described here: - Port forwarding (which was

  • After the BIOS Setup, I get a message saying «loading PBR for descriptor 2...» failed.

    I use my old Hardrive Dell with my new build because it has Windows XP installed and I get the message above after the configuration of the BIOS. All the equipment is correctly connected and is currently recognized in the BIOS, including the HARD dri

  • SigmaTel C-Major audio driver not running

    Have Vista Home Premium 64 bit and receipt the Sigmatel error may appear.  I don't know what this is about and couldn't find an answer when the solution through the MS suggested help tracking.  The sound on my HP laptop sounds great.  suggestions? Re