Value of column in alphabetical order change

Hi friends,

In my table, there is a column whose values are

RA1600002
CA2610001
RA1390001

To change the 2nd position of the data as


RB1600002
CB2610001
RB1390001

To change the letter B, to go to a Temp.table where we maintain data like (SL_NO, Date, Campno)
(1, 01-06-12, RA160,
2, 01-06-12, CA261,
3, 01-06-12, RA139).
Suppose that this month the 2nd letter in the Campno field is then the next month the letter B is in alphabetical order. Assume that the letter is Z, then updates the data by A.

Please let me know how to do this in the Pl/sql procedure.

Thank you
lony

Hi, Lony,

Here's one way:

UPDATE     my_table
SET     str = SUBSTR (str, 1, 1)
            ||  CASE  SUBSTR (str, 2, 1)
               WHEN  'Z'
            THEN  'A'
            ELSE  CHR (1 + ASCII (SUBSTR (str, 2, 1)))
           END
       ||  SUBSTR (str, 3)
WHERE   SUBSTR (str, 1, 5)  IN  (
                                        SELECT  campno
                        FROM    temp_table
                        WHERE   dt = TRUNC (SYSDATE, 'MONTH')
                                    )
;

It works in SQL or PL/SQL.

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
In the case of a DML (such as INSERT) operation the sample data should show what look like the paintings before the DML, and results will be the content of the or a modified tables after the DML.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

  • Request to remove row where the value of column contains alphabets

    Hello

    Could someone please help me to get this application working.

    Request to remove row where the value of column contains alphabets.

    DELETE FROM BIN_ITEM WHERE order_nmb LIKE '% [A - Z] % ' | LIKE '% [a - z] %'

    Thank you and best regards,

    Madam.

    SELECT order_nmb FROM BIN_ITEM WHERE regexp_count(order_nmb,'[0-9]') = 0

    ----

    Ramin Hashimzade

  • How do I change the date last accessed in alphabetical order at the opening of the files within a program

    When I'm going to open or to attach a file in Microsoft Word, Gmail, or any application/program I use, it still shows my files in the order that I have last access to them. I want to display in alphabetical order. How do I do that?

    Thank you!

    Simply click on the Name column in the Word window to sort alphabetically.

  • Windows Live Mail will not sort in alphabetical order 'To' column

    In Windows Live Mail I can click on the header of column and sequence or sort by alphabetical order of most of the columns, but for some reason, it will not sort in alphabetical order the column 'To '.  Some names are grouped, but a lot of seemingly random order occurs.  How can I fix?

    Hi Scott,.

    Unfortunately, this is a known issue that has yet to be resolved.  See http://www.windowslivehelp.com/thread.aspx?threadid=7cd886b5-6726-4ef8-833d-6d19819be8ec where it is attached the answer someone of Windows Live (not only a poster regular like most of us) almost exactly the same question as you - and the answer is quite recent.

    Here's another thread in the same pregnant responded with an MVP who admits that it is a bug that has yet to be resolved.  http://www.windowslivehelp.com/thread.aspx?ThreadId=c601b584-4448-4564-9702-64065e86b1d5 although this dates back to January, apparently he still is not resolved and requires the latest version of the product as well (so that they really have trouble with this code).

    Sorry it wasn't the answer you wanted to hear, but it's something that you just need to treat before iti is resolved.  I would put a bookmark on the page of main support of these links (click back until you get there) and periodically check to see if a solution has been found (or perhaps a work around).  In fact, any questions about Windows Live Mail, you would do well to post in this forum instead of here because they are much more experienced with it, aware of the problems and solutions and quite simply have more people with greater expertise on this product if you are likely to get a better response and more quickly (or even find the solution by searching on the solution and then site forums).

    Good luck!

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • Change the default value of column NOT NULL to NULL

    Hi all
    How can I change the default value of column not NULL to NULL?
    Suppose I have run the following commands:
    SQL> alter table hr.test modify temp_num2 default null;
    
    Table altered.
    
    SQL> desc hr.test;
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     TEMP_NUM                             NUMBER
     TEMP_NUM2                       NOT NULL NUMBER
    Why forced temp_num2 has not changed with the NULL value? I'm under 11.g rel2

    Best regards
    Valerie

    You can NOT change the column constraint NULL to contain NULL values by:

    alter table table_name modify column_name null; 
    

    After this change, the column can contain null values. In Oracle, not null constraints are created automatically when not null is specified for a column. Similarly, they are deleted automatically when the column is changed to allow NULL values.

  • Follow-up - how can I order lines based on a value from column to HFR

    As discussed in my question on queries Top, I have a column that I ordered highest to lowest on a report.

    I have now, thanks to mballo, have a column of row (still hidden) as well as the column that contains the values. I have 25 rows. My use of the Rank ([M, 1:25].ifNN(-1), descending) provides values but no order.

    How can I get the lines sorted by the values in a particular column, then the first line has the highest value and the rest in descending order?

    J

    In the property sheet of grid, there is an option "comes out" about 1/2 at the bottom of the page. Once activated it will bring up a window that allows you to apply the sorting. You can take specific lines or all the rows and then apply that based on a column. Or vice versa.

  • Try to attach photos to an email on Hotmail, but when I open the file, they were put in alphabetical order, and not chronological order I want. Can I change this?

    Hello.   I'm trying to attach photos to an email on Hotmail.  When I open the folder where I want to download the pictures, they are all placed alphabetically.  I want to arrange them in the order, they were taken, which I can do by going in "My pictures", but when I pull the file upwards again in Hotmail, they are given in alphabetical order.  Any ideas?

    Hello Oilfan,

    Thank you for your message.  Since there are two ways to attach photos in Hotmail, I assume you are using the 'Attach' > 'File' version instead of "attach" > version "Photo".  To sort the folder to your liking, you can click right in the pane where you see your files > Highlight ' rearrange icons by "> select" Photos taken we.
    Please let us know if this or help to solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • I want to put the Add/Remove programs in alphabetical order

    How can I put add/remove programs in alphabetical order, they are all caught up I restored my computer to an earlier time and Add/Remove programs came mixed

    I don't understand what you want.

    There is no add/remove programs in Windows 7.

    The equivalent is programs and features.

    The default value is organized alphabetically.

    If you click the column header marked name must change the sorting in alphabetical order.

  • When I go to save or download a file, the menu is back, how to make this return to alphabetical order?

    Then when I save or download a file, it is in reverse alphabetical order. I can't seem to make it back, and I'm sure that I changed all the settings that would entail. Any ideas on how to fix it?

    Thank you in advace

    Not sure, it looks like a Windows tweak. The open file dialog box is a feature of Windows. This happens on other programs? You can try to click on the last icon on top, change Detailsview, click the name header, then the Type column header until the record comes on top in alphabetical order.

  • iTunes started in alphabetical order my albums and playlists.  How to make their return to good order?

    Within the last week so bone, iTunes began alphabetical order my albums and playlists.  It ruins the continuity of the albums, as Dark Side of the Moon, for example.  How can I get it changed?  I don't want my music in alphabetical order.

    In songs or other views of lists sorted on the column of the album. This should albums in the correct order. If this isn't the question could you please provide a few details.

    TT2

  • documents do not place in alphabetical order

    Unfortunately for end when filing a document it is not in alphabetical order. What have I done wrong? In the latest life-saving documents (files) very simple & simple don't remember changing any procedure.

    Have MacBook Pro OS 10.11.1 5.6.1 Pages

    Please help is becoming desperate.

    Thank you John Margo

    Filing of the document? Do you mean by saving the document?

    Where?

    In the Finder?

    Finder has many ways to view and sort your files. You clicked on the name column?

    Peter

  • Xpress Outlook contacts is no longer in alphabetical order.

    Original title: outlook express e-mail

    I use Outlook Express for my e-mail.

    Until the morning, my address book is alphabetical

    order.  It is not encrypted, not real order at ll.

    I did something to chang it?  How can I change to

    in alphabetical order?

    Try click on the column heading in address book display and it should sort the column you click and sort reverse if you click the column header again.  The column header is the top of the column that shows the label in this column as the name, email address, etc.

    Steve

  • Mail/tools in the window select recipients not in alphabetical order?

    I can't get the email contacts listed in alphabetical order, under 'selection of the recipients', they are in a sattered order?

    To sort:
     
    In the Contacts folder:
    Change the display «Détails»
    Right-click on the column heading "Name", "First name", click on click
    on "Last Name."
    Click on the title "Last Name" to sort by who, or click on "First Name"
    header to sort by that.
     
    In a window create a message:
    Click on to:
    Click in the column 'Name' position... it cycles through 4 different kinds
     
    In the properties of the name of the Contact:
    Click on the arrow pointing downwards at the end of the full name box
    --
    Dave N.
    MS - MVP (Mail)
    Windows 7 Ultimate 64
    "Applegrower" wrote in message
    News: * e-mail address is removed from the privacy... *
     
    I can not get the e-mail contacts listed alphabetically under "select."
    "recipients", they are in a sattered order?
     
     

    Windows 7 Ultimate 64

  • How can I get image files, in a folder in alphabetical order?

    Can someone tell me how to put a section of photos that I keep in a folder in my pictures in alphabetical order. They are all appointed, but can't seem to get in order. I use Vista.

    See you soon...

    Moved from feedback

    Original title: photos

    Hello

    Try these procedures:

    1. right click in the folder (and not on a file name) and choose sort by > name

    2. change the details view and click the last name column heading

    Don

Maybe you are looking for

  • Palm Desktop password protection

    Although I no longer use my handheld device Palm (Treo 755 p) I use the desktop app from Palm on my computers, mainly because I like the software allows for the protection of specific password of any given note, contact, or another entry.  When I rec

  • Pavilion a200n

    I am trying to find a driver for the ethernet card integrated on this pc.  I do not know the model of realtek, and drivers that I found while searching have failed. What is the model #?  And where a driver Windows Server 2003 for him would be install

  • Difficult to use the outputs analog to generate a predetermined file

    Hey all,. I tried to produce a file predetermined to a 1 kHz on my USB 6343 Multifunction DAQ analog output channel. Here are the questions I have am experiencing: 1: output file so fast my o'scope cannot even pick it up. 2: when you try to stop the

  • I am trying to install Windows 7 and I get the error code: 0 x 80070017.

    I tried for months to install Windows 7 and I get the same error message.  In fact, I gave up trying, but my computer is running slowly and gel a bit so I thought I would give it another chance.  Can you help me?

  • Momentics IDE appears to hang in debug mode

    Hey. I just started using Momentics IDE 2.1.1 with the 10.3.1.2267 simulator, and after getting an error message (I'll come back to that) panels of FDI seem stuck in debug with the debugging in the top pane on the left. I pressed Stop, the big red bu