Fill two empty columns with the values in a column (all in the same table)

Can someone point me in the right direction? I want to fill the column prefix and suffix with the AcctNum data.

"Prefix is the part of the number before the '-' and the suffix is everything after the '-'. '. Write a SQL command to fill the column prefix and suffix.
*Accounts* 

AcctNum   Prefix   Suffix
-------   ------   -------
123-0097
X089-056
123-0097
123-0098
F3377-D
X089-057
X089-058
3-009712
It is supposed to look like this:
*Accounts* 

AcctNum   Prefix   Suffix
-------   ------   -------
123-0097    123     0097
X089-056
123-0097
123-0098
F3377-D
X089-057
X089-058
3-009712
That's what I came with, but it does not work because it is basically putting multiple values into a single cell:
update accounts
     set prefix=(select substr(acctnum, 1, instr(acctnum,'-')-1) from accounts),
     suffix=(select substr(acctnum, instr(acctnum, '-')+1) from accounts)
     where acctnum=(select prefix||'-'||suffix from accounts);
I want this query is incredibly easy and I have forget something. Any help is greatly appreciated.

Published by: 885913 on September 18, 2011 12:53
UPDATE accounts a
SET    ( prefix, suffix ) = (SELECT Substr(acctnum, 1, Instr(acctnum, '-') - 1),
                                    Substr(acctnum, Instr(acctnum, '-') + 1)
                             FROM   accounts b
                             WHERE  a.acctnum = b.acctnum);

Tags: Database

Similar Questions

  • IMessage Apple Watch has two interviews separated with the same person?

    My new Apple Watch has a problem with iMessage and I know how to fix this on my iPhone but not watch?

    On my iPhone, that my ID apple is connected to more than 10 devices and sometimes when a new device is added, it adds the addresses on my apple for iMessage and FaceTime ID and I always fix by unchecking the addresses that I don't want in the application settings under "Messages" and "FaceTime." However, this isn't the same thing to watch because there is no option in the settings on the Apple Watch and the watch App on my iPhone.

    I would like to help please?

    Hello

    Apple Watch uses the same parameters (for how you can be reached and how new conversations are started) for Messages as your iPhone.

    If you have two interviews separated with the same person, the following steps may help:

    • On your iPhone, check if there is more than one contact form in Contacts of this person (if so, remove duplicates).
    • Delete old Messages conversations with this contact on each of your iPhone and watch:
      • iPhone: app Messages > swipe to the left on a message thread > delete.
      • View: Open the Messages app (from the home screen, which is accessible by pressing the digital Crown) > swipe to the left on a message thread > tap on Trash / delete.
    • On your iPhone in the app Watch: Watch My > general > reset > press reset sync data:
      • You won't see anything happen after pressing it (the process runs in the background, invisible to the user).
      • Leave a minute or two to allow the course ends.
    • Restart your iPhone and your watch (turn the two together off the coast, then restart your iPhone first):
  • You can have two stored functions with the same name?

    Hi all

    You can have two stored functions with the same name?

    My version of DB - connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0

    Thank you.

    You can have the same name as long as they are within a package and with different parameters

    create or replace package test_pkg

    as

    function my_func (p1 in number)

    return number;

    function my_func (at number p1, p2)

    return number;

    end test_pkg;

    /

    create or replace package body test_pkg

    as

    function my_func (p1 in number)

    Return number

    as

    Start

    return 0;

    end;

    function my_func (at number p1, p2)

    Return number

    as

    Start

    return 0;

    end;

    end test_pkg;

    /

  • Is it possible to use two different computers with the same adobe - ID and the same adobe license?

    Is it possible to use two different computers with the same adobe - ID and the same adobe license?

    Hi Morten,

    Yes, you can have your subscription or your license installed on two different computers with the same adobe id, however use one at a time.

    Please let us know if you have any questions, more about it.

  • FRM - 40202:Field must be entered on two blocks with the same table

    I have two blocks, blockA and blockB, both from the same table that is tableX.

    When I ask of blockA and it worked, then I go to blockB and modify data, and save, there is no problem. But when I do not run the query of blockA or if the query did not return any results, I go to blockB and change some data then save, I got this error. The cursor then go to first blockA point. So now, I have to delete this empty line before the Save.


    Any suggestion?

    you set a few initial values programmatically for a block?
    in this case, the status changes to INSERT and you will get this message.
    You can check the staus with GET_RECORD_PROPERTY (1, "A BLOCK", STATUS), e.g. with the trigger KEY-COMMIT.

  • Publish two different clients with the same ID Adobe DPS publications

    Hello:

    I have a publication about InDesign and I downloaded the Adobe server with my Adobe DPS account. For the first publication, I published the publication with the producer of Folio on the portal digitalpublishing, and then I created the application using the Adobe viewer generator. Then I tried locally on my iPad. It was working fine and I could see my publication.

    Now, I need to download a new publication for another customer with the same Adobe DPS account and I need to create a different application with the new client look and feel, but I don't want to show this new application, only the last was first published.

    In a nushell, I need to keep separate two publications (or more) when they are published if I use the same account of DPS... Is this possible?

    Cordial greetings,

    Hi Leo,

    Each title should have its own publication AdobeID (a title may contain several editions / folios).

    The question for each title, you want to work on an account supplied with Adobe. Make sure that you have configured the corresponding emailaddress / emailalias. For example [email protected] and [email protected]

    Once the accounts have been implemented, you can:

    * Download and organize several folios for this publication in the corresponding Folio producer

    * Create a visualizer with your Builder Viewer and on the first page provide the AdobeID for publication to give

    You can ask new accounts of publication any time, and these are included in your subscription DPS.

    During your first obtained account Provisioning, you should have received an excel document to ask the commissioning for various publications. In this document, you can list the accounts you want to use for publications, individual users of the generator system and Viewer access.

    With sincere friendships.

    KlaasJan Tukker

    Adobe Systems Benelux

  • Windows experience index for two different laptops with the same configuration of maximum output power

    [I have two almost identical laptops Lenovo T61p and running W7 64 Ultimate b: has] has an Intel T7700 processor and 8 GB of RAM. [B] has a CPU of Intel T8300 with 4 GB of RAM. They are clocked at 2.6 GHz and have identical hard drives.

    When the system is running Windows Experience Index, it does to 2.6 GHz. It doesn't matter what is the result.

    When the system B runs the WEI, it becomes 780 MHz. In the end, he will return to run at 2.6 GHz. Needless to say that it will reduce its index to I / 2 of the other system. During any normal operation, the processor remains a 2.6 GHz

    All other values of the indices are similar and irrelevant.

    As far as I checked, the two system has the same configuration of power to maximum performance, I did not miss something. MSCONFIG are also identical.

    Any ideas about where to look to fix this behavior?

    See you soon

    Rolando

    WEI is a meaningless number that does not reflect anything in reality.  You win nothing in this hunt.  Because it is a useless number, that it has been deleted in windows 8

  • Two remote subnets with the same network address

    Hello

    We have configured on VPN site-to-site ASA remote network 192.168.1.0/24.

    New requirement is to set up the new VPN site-to-site (additional) tunnel which also has remote network 192.168.1.0/24.

    Will this work 'out-of-the-box"with ASA - ASA will know where to send the traffic based on source AND destination IP address?

    Or it will not work and we will have to use double NAT to establish the new tunnel?

    TNX

    This may be possible with sub condition two.

    (1) the two VPN must be on the same interface as the external interface of the ASA

    (2) your IP address of end encryption must be different for the two VPN.

    As VPN for A client--> access-list-VPN-client license host 10.1.1.1 ip 192.168.1.0 255.255.255.0

    VPN client b-->-list of access VPN-Client-B permit host ip 10.1.1.2 192.168.1.0 255.255.255.0

  • Photoshop can be installed in two different computers with the same subscription? and if so, a computer can be a Mac and other Windows-based?

    One of my hobbies is photography, from time to time I need to improve a picture for my personal use, I do not have something comercial. At home, I have a Mac computer, in my office, I have a Windows-based computer, can I have my moved license from one computer to another, I will never work in two computers at the same time, but now you pay for an annual subscription, I was wondering if it is possible, I don't want to pay for two licenses for the very little work I do in Photoshop your answers will be appreciated.

    Thank you

    Wilson

    Hello

    You can install the software on two computers. These two computers can be Windows, Mac OS, or everyone.

    If you install on a third computer, you will be asked to turn off this feature on the other two computers. You can then re-enable one of the two previous computers and use Cloud Creative apps on it.

    Thank you best regards &,.

    MoHA

  • Cursor of two or more with the same key value

    Is it possible to have a slider (c1) that has a key value that can be used in another cursor (c2)?

    See the example below:

    / * Sum of all economies where the amount is 50,000 or more * /.

    CURSOR c1 IS

    Select cusno, sum (savings)

    deposits

    Cusno group

    After having sum (savings) > = 50000;

    / * All customers in the system * /.

    CURSOR c2

    Select firstname, lastname, cusno, address, telephone

    of the customer;

    This, I would like to put in a file: all customer (from c2) information with economies falling into the first slider (c1).

    Is this possible?

    1 with cust_dep like)

    2 SELECT CUSNO, SUM (savings) DEPOSITS BY CUSNO GROUP TOTALS)

    3. SELECT c.firstname

    4, c.lastname

    5, c.cusno

    6, c.address

    7, c.phone

    8, d.totals

    9. customer'S c

    10, cust_dep d

    11 WHERE c.cusno = d.cusno

    12 AND d.totals > = 50000

    13 * ORDER BY c.cusno ASC

    SQL > /.

    FIRSTNAME LASTNAME CUSNO

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

    ADDRESS PHONE TOTALS

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

    John            Doe                      1

    123 main St. Anytown, USA 12345-123-456-7890 50000

    John Smith 3

    456 main St. Anytown, USA 12345 132-546-7890 58000

    SQL >

    SQL >

  • Can I download my apps on two different computers with the same CC membership?

    An iMac, a PC (Windows 7). Download the applications on both computers?

    Of course, you can download on any 2 computers according to your choice.

    You can install on a Windows and a Mac. or 2 Windows or Mac 2

  • Two thunderbird profile both at the same time with the same user account

    Dear Sir
    I would like to use Thunderbird two at a time for two different profiles with the same user accounts.
    I use linux OS.
    I thought using the:

    1. Thunderbird Pei Profile1 &
    2. Thunderbird Pei Profil2 &

    But at the launch of the second order, that nothing is happening.
    Appears in the foreground thundirbird already started.

    If possible use this configuration now or in the future nex?

    General rule, thunderbird runs only a single instance of a profile.
    However, there are two options, you can try.
    You can use an addon esily switch profiles:

    There's more help here:

    He said: "several instances is expected for debugging, so use it at your own risk.

    One method would be to use: start > run
    "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"-no-remote Pei profilename

    There is a space before '-no '
    and also before '-P'
    followed by a space and the name of the profile

    You can create a shortcut icon to run each separate profile.

  • Windows allocate two disks with the same letter

    I had a systems problem where the computer would not be arrested because of the computer by providing two different players with the same ID letter ("F") during the race. The program kept asking I have reformat the drive "F". I had a former player ID'd as ('' F ''), I accepted. When the computer has been restarted I had reformatted the bad drive which was not initially ID had as player ("F").

    I get a message stating, Windows has assigned a drive letter for the U3 drive that already has another on your computer, or there is no more available on this machine drive letter. Try disconnecting that drives any network that you have connected to your computer, and then restart U3 by double clicking on launch 3. exe or the U3 icon of the CD-ROM system. Once the U3 Launchpad is running, you can reconnect the network drives.

    I deleted all the additional disks (4) and restarted the computer and still get the same message with all the drives removed. I followed the instructions as guest above and restarted the computer and still get the same message.

    The line above also comes with a troubleshooting option button, but when I select this it takes me to the Web and trying to sell me U3 drives.

    How to resolve this conflict.

    Go to start / Control Panel / administrative tools / computer management / disk (with the drive plugged already of course) and make sure that the screen is maximized and then press the PRTSCR button.  Then click on start / all programs / Accessories / Paint and open and right click on the area map and click on paste to create an image of screenshot of disk management.  Enregistrer save as Disk Manager, then select it. JPG file type and put it on your desk at the moment.  Then, go tohttp://skydrive.live.com/ and open a free SkyDrive account if you do not already have one, then add the. JPG file to a folder on SkyDrive.  Click on the file and on the bottom right, it will provide information on the file whose link to access. Please copy this link and post it here in your next reply so I can see for myself rather than ask a thousand questions on what he says.

    I don't see how you could have used all the letters of reader available unless you have drives mapped to all kinds of network locations or even just disks, partitions or folders on your own computer (but a lot of them).  How many local mapped make you thing you have (as opposed to say the computer)?  I also don't understand how the system can assign the same letter to two different drives, partitions, networkk places, records or other in all circumstances - something is wrong and I don't know what it is given the information available at this stage.  Maybe see Disk Manager will help you.  Which version of Vista you are using (for example, 32-bit Vista Business SP2)?

    Thanks and good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • BlackBerry Smartphones using two BB with the same account of Blackberry.

    Currently, I have a BB 9900 and is considering obtaining a BBZ10. The 9900 has a standard sim card by which the Z10 I think a micro sim. (I still have to talk to my service provider relating to the regime of a sim 2)

    Is it possible to use two phones at the same time, if my provider allows, regarding BB services etc. using the same account etc?

    I thought that I have addressed this before first topic to contact my ISP.

    Thank you.

    Kind regards.

    You ask the subject from the BBID even on both devices?

    Yes, to a certain extent, on the data.

    E-mail and social accounts like Facebook and Twitter works perfectly.

    BlackBerry Messenger will use only a BBID on a device at a time... If you have the same BBID on both devices, you will need to choose which will be your active BBM.

    Of course, the main question to this is if your mobile operator will allow two SIM cards with the same account. Doubtful.

  • Can we pay two or more subscriptions of Adobe CC with the same credit card?

    Hello

    my brother and I are at the school, and both of us are interested in having all the Adobe software (in the creative cloud). I know we have the ability to install the software on two computers with one subscription, but the problem is, we can run those at the same time. So, the only option is to buy two subscriptions of Adobe. My question is, if my mother pay subscriptions, is it possible for her to pay the two of them with the same credit card, students of price?

    Thank you

    SCI

    Hello Tommy.

    Yes you can use the same credit card to buy a subscription on a second account.

    Concerning

    Bianka Attre

Maybe you are looking for