Copy data of two rows together into a new row

Hello everyone.
I have a question about copying data of two existing rows together into a new third row.
See this short example:
This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
In the past data were saved randomly in one of those rows.
This is the table State:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
2
11
Mr. Smith, no answer.
Waiting until December
3
11
Pls create PO.
Old PO was cancelled
4
5
No access to system.
From now on everything has to be saved to the empty STATE_3 but I also need the old entries from the past which also have to be copied together into STATE_3
like this:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
Customer is waiting. Call from yesterday
2
11
Mr. Smith, no answer.
Waiting until December.
Mr. Smith, no answer. Waiting until December.
3
11
Pls create PO.
Old PO was cancelled.
Pls create PO. Old PO was cancelled.
4
5
No access to system.
No access to system.
Is there an easy SQL-command?
Thanks for any help.

Hi,
DB2000 wrote:
Hello everyone.
I have a question about copying data of two existing rows together into a new third row.
See this short example:
This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
In the past data were saved randomly in one of those rows.
This is the table State:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
2
11
Mr. Smith, no answer.
Waiting until December
3
11
Pls create PO.
Old PO was cancelled
4
5
No access to system.
When you say "row", do you mean "column"?
DB2000 wrote:
Because in this case STATE_1 and STATE_2 are only text of a log file/history.
So I think 1NF isn't really violated and because of performance of the database in this case it's better to put obsolete rows together.
Why do you think that?
The definition of First Normal Form is that every column of every row contains 1 piece of information, not a variable number of pieces.  Whether or not that data is only text of a log file/history has nothing to do with it.
You might claim you have good reasons (such as performance) for violating First Normal form, but you can't say that you're not violating it.

Similar Messages

  • Different ways to copy data between two schemas in one instance

    Hi there,
    I am searching a good way to copy data between two schemas in the same instance.
    Both schemas have an identical structure such as triggers, tables, views and so on. The only difference is the purpose: one is the productivity system and one is for development.
    I looked at datapump but I do not explicit want to export / import. I want to keep the data in the productivity schema as well as copy it to the other schema. Any ideas? I found out there is a copy statement but I dont't know how that works.
    Thank you so far,
    Jörn

    Thank you for your replies!
    I also thought of creating a second instance for development and move the dev - schema to it. I just don't know whether our server can handle both (performance?). Anyway the idea is to have a possibility to quickly rebuild the data inside a schema without indixes or triggers, just pure data. I thought the easiest way would be to copy the data between the schemas as they are exactly the same. However if you tell me DataPunp is the best solution i won't deny using it :).
    When you export data a file is created. does that also mean that the exported data is deleted inside the schema?
    best regards
    Jörn
    Ps: Guido, you are following me, aren' t you? ;-)

  • How to map 2 tables together into a new one, like an Union?

    Hi.
    I am new in Oracle Data Warehouse Builder and what I'm wanting to do could be simple.
    My question is: How to map 2 tables into a new one? That is, what I need is to do a Union.
    See the following tables:
    What I have is:
    ---------------+ ---------------+
    | A | B | | A | B |
    |--------------- |---------------
    | 10 | 34 | | 13 | 39 |
    ---------------+ ---------------+
    Table 1 Table 2
    What I wish is:
    ---------------+ ----------------------+
    | A | B | Original table |
    |--------------- ----------------------+
    | 10 | 34 | 1 |
    |--------------- ----------------------+
    | 13 | 39 | 2 |
    |--------------- ----------------------+
    Then, I need put all data together into a new table and this new table should has a new column showing the original source of data to each record.
    Can I do such thing?
    I'm using the Oracle Warehouse Builder and trying to do a map in this way.
    Any hint will be very helpful. I also will appreciate an indication of some document which can show how to do it.
    Thanks .
    Rodrigo Pimenta.
    Brazil.

    Use the SET OPERATOR. That should help i guess.

  • Is there a way to copy multiple sheets in a Spreadsheet into a new Spreadsheet?

    One of my spreadsheets is buggy, crashing each time I try to save the changes I've made. Figure I need to start from scratch with a new one. But this spreadsheet contains many months of sales (each month being a page). How can I copy multiple pages to paste them into the new spreadsheet?

    That's just it: When I Select All to Copy, only the current sheet I'm looking at is Copied. How can I copy ALL the sheets? Is this not possible on an iPad?

  • Is there a way to scroll between footnotes in the new pages version and to actually copy an old text with footnotes into the new version without losing them or having them in the text?

    Since my update I am no longer able to scroll between the footnotes. I have to klick on each one to change something. That is unbearable since I have to write a lot of academic texts which usally have a ton of different footnotes. I also can not copy some of my old texts into the new version without losing the footnotes or having them in the middle of my text. Does anyone know a trick or if apple will change that for good? Thx for any support - it really drives me crazy

    Isn't that you asking how to get it (undefined) back?
    If you never had Pages '09, you can buy it from Amazon very cheaply:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&sid=f68e84cd2ec6 123bd2ed93806c7e7fb6&mforum=iworktipsntrick
    Peter

  • How to copy data between two tables row by row

    Hi All,
    I have three tables TableA and TableB and TableC
    I wanted to write a stored procedure to copy data row by row from TableA to TableB and then update TableC by replacing any record that has the old id (before copying) to the new id after copying the data.
    here is the steps 
    iterate throw all the rows in tableA ( probably with a foreach)
    in each iteration we will do the following:
    Get current ID (identity) for each record in TableA ( will call it @oldID)
    Insert the row in TableB
    Get the new ID for the row from TableB will call it (@NewID)
    find rows in tableC that has the (@oldID)
    replace all ids in tableC with @oldID to @NewID
    Thanks in advance

    0
    TableA and TableB are identical they should have the same columns 
    TableC columns will be ( ID, TableA_ID , Notes)

  • Copying data between two tables with different structures

    I have two tables. second table has three extra fields at the end. How can I copy data from first table to the other? I tried the following but it does not seem to work:
    INSERT INTO second_table ((select * from first_table),'text','text',5)
    Please help. Thanks

    INSERT INTO second_table SELECT col1, col2, col3, .., 'text', 'text', 5 FROM first_table;
    Cheers!
    r@m@

  • How to superimpose data from two different charts into a single chart?

    I have a single chart that lists numbers by month for a two year period like this:
    Jan 100
    Feb 200
    Jan 103
    Feb 199
    The numbers are all in the same column rather than different columns.
    I'd like to creat a chart that plots the data for each year on the same X axis, so that I can see the two january numbers, the two february numbers, etc. on top of each other. But nothing I've tried seems to work. Numbers seems to always put the second january after the first december on the x axis rather than recognizing it as a new series to be superimposed on top of the original january.
    Is there some way to fix this short of putting the data into a new column?

    What your describing is a table of wht I would call raw data. I would also have a summary table that would use functions like sumif and sumifs, then make my chart off that. This table would have each month in a column and the  years across as headers. ( if you're familiar with excel, it would be the equivalent of making a pivot table and chart, but manually).
    Jason

  • How to fill the data of two different tables into one?

    Hi Experts,
    I have two tables named CDHDR and CDSHW(structure). I have extracted the  data from these two tables through two function modules named CHANGEDDOCUMENT_HEADER and CHANGEDOCUMENT_POSITION. Now I have the data in to different tables.
    These two tables neither has relationship with each other through any field nor have any field which exist in both. Can anyone tell me in this case what should be the process to take the data of both the tables into one table. How can I match the record of one table to another?
    thanks a ton in advance.
    Edited by: Moni Bindal on Apr 28, 2008 4:16 PM
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:42 PM

    Hye Bindal,
      without a relation, it is not possible to club the data of 2 internal tables. More over it depends on the requirement as to y u should club to non related quantities in an internal table.
    if you wish to do so, one thing is it has internal table which includes the strucute of the 2.
    data: begin of ty_out,
              first type first_structure,
              second type second_structure,
             end of ty_out.
    data: itab type standard table of ty_out.
    data: wa type ty_out.
    loop into it1 into wa1.
    move corresponding wa to wa1.
    append wa to itab.
    endloop.
    loop into it2 into wa2.
    move corresponding wa to wa2.
    append wa to itab.
    endloop.
    now the internal table itab will have all the contents of it1 and it2.
    <REMOVED BY MODERATOR>
    Thanks,
    Imran.
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:43 PM

  • How to copy header items and paste it into a new channel

    Hi everybody,
    i'm trying to customize my tasks with DIAdem and got some big problem. I have a channel table in VIEW with 295 columns and have added a new column.In this column i want to write all the Header Items i've got.
    I've created a new channel with:
    Call ChnAlloc("Betriebsdaten_akt_Monat", 295, 1,DataTypeString,"Text")
    Call Zusfassg.Columns.Add(296)
    Then I use this command to read the header items:
    Set MyHeaders = View.ActiveSheet.ActiveArea.DisplayObj.HeaderItems
    But how could i now paste all these items into the new column i've created?
    Thanks in advance for your help.
    Kind regards
    Patrick
    Patrick Etoumann

    Hello Patrick,
    to be honest, I did not completely understand what you are trying to do - so if the answer does not fit 100%, please give me some more information about your task.
    Within the DIAdem Help (topic: Object HeaderItem) you can find this short script:
    Set oMyHeaders = View.ActiveSheet.ActiveArea.DisplayObj.HeaderItems
      For Each oMyHeaderItem in oMyHeaders
      Call MsgBoxDisp(oMyHeaderItem.Name)
    Next
    It calls a messagebox for each configured headeritem. If you want to write the titles of these items into a new channel you can use the ChT() variable. Specify the row and a textchannel as parameters of this function.
    But because you created a textchannels with a length that equals the numlber of displayed channels i think you rather want to copy the content of a specific header property to the rows of that column. In this case it might be most convenient to program a for loop and use the loop variable to reference the individual channels. With the command ChnPropGet(), the channel number and the property name you can read the value of a property.  Even here, use ChT() to store the data into the new channel.
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Getting two different libraries into my new iphoto 11

    Hi
    I just got a new MBA today (Merry Xmas!!). We have two other macs, and I was wondering if I can transfer both iPhoto libraries (different) into the new mac. I know you can copy the iPhoto library from one mac to another, and all the library will appear in the iPhoto of the computer where it was copied. But here, I have two different iPhoto libraries, and I hope there is a way to unify them into my new MBA.
    Any suggestion will be appreciated.
    Thanks
    Laurent

    As Niel said (I read more about that on the help of iPhoto now), just copy the folder 'iPhoto Library' (in the 'Pictures' folder) of your wife MB, and paste it into the 'Pictures' folder of your MBP, certainly with a different name.
    Once it's copied, then hold the Control button while starting iPhoto: there, it's supposed to ask you which library to connect to, and you just select the one you want.
    Sounds easy, haven't tried yet.

  • How do you Copy a row to create a new row in the same table?

    Hi,
    We have a PurchaseOrderHeaderView object and on click of Copy Purchase Order we want to copy a row in PURCHASE_ORDER_HEADER table to create a new row. We don't want to copy the primary key only the remaining fields.
    Regards
    Madhuri

    If you use ADF BC, you can create a new row programatically via createRow and use a sequence to create the Id and use the "original" row (probably the current row in the view object) to copy the values from to newly created row. Then use insertRow and commit to create the copied row.
    Ronald

  • Sort column doesn't take into account new rows

    Hi,
    I'm using jdev 11.1.2.3.0
    When I add new rows to table and then try to sort any column before commit.
    The sort does not take the new rows into account when performing the sort.
    How could I solve this problem without commit?
    Thanks

    You have to set the query executioner mode to in memory so that the temporary rows are also taken into account when sorting.
    http://docs.oracle.com/cd/E16764_01/apirefs.1111/e10653/oracle/jbo/ViewObject.html

  • Compress two .jar file into a new .jar file

    Hi all, i would like to ask it there anyone know how to compress two or more .jar file into one new .jar file?
    because i'm currently need to engage with one big project which have to add 34 .jar file into JCreator, so that the relevant classes can be found when compile the code.
    another question is, what is the maximum archive can be add into JCreator? is it limited or unlimited?
    So, any idea from you all?
    Regards,
    poh_cc

    You should probably ask the authors of JCreator about the limitations of it.
    The classloader can't read jars from jars and I would advice against extracting all jars and jar all classes into one big fat jar.
    Kaj

  • Easy way for group moving multiple rows to insert under new row?

    Hi All.
    I have been trying to find a way that will let me move - say - 20 rows (#'s 105 - 125) each with 15 columns to a space that fits under an existing column that may be further up - say - row 5. I would like to do this in a way that does not require my creating 20 rows under row 5 in order for there to be more space between row 5 that has data in it and row 6 or 7 that may have data in it.
    Right now I am creating a row, creating another row, multiple selecting these two rows and hitting down arrow to create new rows two by two ten times.
    I have a case now where I would like to start moving organized pieces of information around that have 40 to 100 rows of data and it is becoming increasingly inconvenient to have to do this.
    Thanks for any tips, tricks, pointers etc.

    Jon,
    This takes some patience and some practice.
    Click on the first Row label and Shift-Click on the last Row Label of the range of rows you want to move.
    Now you have a large selection. Here comes the delicate part that may take some practice. Make sure your work is saved before you begin practicing. Read these instructions thoroughly before you begin.
    Hover over a label in the selected range of rows. Click and drag to the left, pulling the selected rows off the main table. Hold on to the mouse switch and don't let go yet. Now move the selection that you have a hold of back over the main table and watch the horizontal lines that separate the rows. You will find that double lines appear under the cursor. This indicates where your selection will be inserted if you let go right now. Move your pointer up or down the table until you come to where you want your selection to go and then release the mouse.
    Jerry

Maybe you are looking for

  • Bug in 10.1.2.0.0? Doesn't return UserManager properly

    I've found this is a problem only with the standalone version of OC4J 10.1.2.0.0 I'm trying to lookup my custom user manager in my web application: MyUserManager uManager = (MyUserManager) ctx.lookup("java:comp/UserManager");It only returns the JAZNU

  • Cheque Approval in F110

    Hi Experts I have requirement from customer where they are looking out for this particular approval. While doing payment run customer need system should provide workflow for approval of CFO and CEO (2 Levels) Has any body has worked on workflow with

  • 'On alarm' flow of the "Pick" activity thorws unexpected server error

    'On alarm' flow of the "Pick" activity does not work. It always gives unexpected server error.      Navigation: Start JDevloper ->asynchronous BPEL Process ->Pick Activity-> on alarm branch Can anyone help please thanks

  • While Loop in Gantt Chart Value

    the problem is in the "createDataset" method whereby i want to do a while loop where i can check the data inside the database that i just inserted. after that i want to pass in all the data that is needed to generate the Gantt Chart. can anyone help

  • Portal practice

    I recently installed portal on my machine. What all practice examples can i try out.? Any suggestions for newbie are welcome... Points will be awarded accordingly.