Need to merge data

Hi All,
I have some data set that i get with below query
SELECT cc.emp_no, SUB.SUBJECT_ID,SUB.SUBJECT_NAME,SEQ,
CASE WHEN SEQ<> cycleid THEN 'YES' WHEN cycleid is null THEN 'YES' ELSE 'NO' END FLAG FROM subject sub,
emp_dtl cc,emp_dept_dtl re,(select rownum seq from all_objects where rownum <= 3)x
WHERE SUB.subject_id= RE.subject_id(+)
AND CC.emp_no=SUB.emp_no
AND cc.emp_no= '123' ;
and the output is below
123     4     Emp1     1     NO
123     4     Emp1          2     YES
123     4     Emp1     3     YES
123     5     Emp2     1     NO
123     5     Emp2      2     YES
123     5     Emp2      3     YES
123     5     Emp2     1     YES
123     5     Emp2      2     NO
123     5     Emp2 3     YES
123     5     Emp2      1     YES
123     5     Emp2     2     YES
123     5     Emp2      3     NO
123     6     Emp3     1     YES
123     6     Emp3     2     YES
123     6     Emp3     3     YES
How to combine the data of subject id = 5
Like to have data like this
123     4     Emp1     1     NO
123     4     Emp1          2     YES
123     4     Emp1     3     YES
123     5     Emp2     1     NO
123     5     Emp2      2     NO
123     5     Emp2      3     NO
123     6     Emp3     1     YES
123     6     Emp3     2     YES
123     6     Emp3     3     YES
Please help regarding this
Thanks,
Sanjeev

i think this is a question for the pl/sql forum: PL/SQL
please explain: what rules do you use to combine id=5?
why do you only combine id=5?

Similar Messages

  • What does the Merge Data Stream processor do when there are multiple input streams to it from the same reader?

    Hi,
    I have a process with a reader of master data that outputs 5 records that feeds simultaneously into 3 different lookup and return processors.
    Each lookup and return processor brings some data back from a detail table. There can be multiple details so I follow each lookup processor with a split records from array processor. Hence I end up with 3 'streams' of data. Stream 1 has 8 records, stream 2 has 5 records and stream 3 has 6 records.
    I join all these streams to a Merge Data Streams processor.
    I end up with 9 records so although the help for the Merge Data Streams processor says 'Merge Data Streams does not perform any transformation, matching, or merging of records' there is clearly some merging going on.
    What is the behaviour of the merge data streams processor in this scenario?
    I have added attributes and flags into each of the streams. How many records should I see and what values should the added attributes/flags have (some records show attributes/flags from all 3 streams whereas others show just those attributes/flags from one stream).
    I have developed a test case simply to understand what the processor is doing but it's not obvious and furthermore it's probably unwise to develop EDQ processes where the processor behaviour is not documented and guaranteed to remain consistent. What I am trying to achieve is to bring all of a person's (the master data) various details (assignments, employers, etc.) together so we can check the data (some rules require data from multiple details).
    Thanks, Nik

    Cheers Mike - and for the explanation of the terms.
    I think I understand now how it's supposed to work.
    What I'm finding however is that when I set a flag to Y at the beginning of a path (that includes a lookup and return and then split records from array processor) that flag is showing no (i.e. an empty) value in SOME of the records shown in the subsequent MDS processor (it's fine the very last split processor before we get to the MDS but then again there are fewer records in that split processor than the MDS).
    In my case there are obviously more records in the MDS processor than there were in the original reader (because the lookup and returns are configured to have unlimited maximum matches). As mentioned, the different paths return different numbers of  records before being combined in the MDS. Say a reader has 5 records and path 1 returns 8 records in total including a path-specific flag (flag1, set to Y) but path 2 (that again adds its own path-specific flag (flag2, set to Y) returns just 5 records (since nothing was added from the lookups) are you saying that flag2 would show as 'Y' for all 8 records shown in the MDS?
    Hopefully you would be able to see what I mean if you try to create a process like the one I've described (or I can upload a package).
    Re. the purpose of the separate paths approach it is simply to allow the visualisation ('showing the working' as Neil puts it) of the different checks being carried out by the process.
    This is considered one of the benefits of the tool over writing SQL queries (with outer joins, query criteria, etc.).
    Also, as mentioned I was following an example that Neil put together for us to ensure that we are doing things in a 'proper' and supported way.
    If we put all the lookups, etc. for all the checks into one datastream then it no longer becomes so understandable and the value of joining processors in a process over simply writing SQL becomes questionable; arguably the EDQ process in fact becomes less easy to understand than simply writing SQL.
    Also, to go down this route I will need to revise the (what was previously substantially working until I revised it) processes that I have already developed.
    Thanks, Nik

  • Merge data, dataflows from 2 BW systems into one to reduce cost and one way of working

    Hello BW gurus,
    I have a question here in my current project we are asked to merge data from 2 BW system to one.
    This basis for this is there each  BW system has their own R3 systems.
    First they have now started to migrate data from ECC1 system to ECC2 system using DSM tooling and mapping tables to align to one way of working.
    Only open items are migrated from ECC1 to ECC2.
    BW1 system is connected to ECC1 and BW2 with ECC2.
    Now they want to merge BW1 to BW2.
    In BW2 historical data from BW1 is needed.Data for open items from BW1 will come from ECC2 as they are being migrated.
    What should be the approach to migrate the historical data from BW1 to BW2.
    There can be several scenarios :
    1)BW Objects migration
    2)Data migration
    3)How to deal with common object names used in both systems for DSO and cubes where the data flows in both systems are same?
    4)How to deal with common MD info objects (eg:0customer,0vendor) and also if the cutomer numbers in both system are same but with different description and vice versa.
    5)How to deal with same kind of transaction data?
    I went through many other discussions on the same topic but there it is mentioned to concatenate the 0logsys or sourcesytem in the dataflows where common master is used but creating z objects a copy of 0 objects like 0customer etc.
    In these cases if I need to do this to existing 0customer object in that case it would mean deleting data from all flows where 0customer is used if I want to add sourcesytem the compounding which is not favourable.or in case of creating z objects of existing MD IO then add sourcesytem compounding in those cases also it would mean I have to use the new zobjects in all those DSO/Cubes/MP/Queries in place of original object which is also a lot of effort and also load data into it.
    This can be done for DSO and cube flows but not MD IO.
    Please suggest some good approaches /ways to the above criterias I have mentioned.
    System speccification: Currently we are on BW 7.4 version but with the merge we cannot go on Hana due to cost control so we need to use the BW system only.

    Ritu,
    There is no way you can create single model for 2 different R/3 systems (unless SAP decides to implement this in later versions).
    If you still want to stick with a single model approach, I would suggest to use <b>Webservice</b> model where the R/3 interaction part would be taken care by WebService.
    Ashutosh

  • Merging data from 2 schemas with same object structure into one schema

    Hi
    I want to merge data from 2 schemas in different environments ( say test1 and test 2) into 1 schema ( say Test_final) for testing. Both these schemas are having same structure, the data can be same or different.
    What I did is that I took an export of schema on Test1 and then import it into Test_final. Now I need to merge/append data from Test2 into Test_final.
    I can not merge the data with import due to primary key constraints and also import doesnt support this feature, so I tried SQL*Loader to "append" the data by using sequence to generate Primary key.
    But my worries are that since new primary keys are generated so foreign keys will become invalidated and the data will not be consistent.
    Is there any other way to do this task..
    Regards
    Raman

    This approach might be better...
    create table test_final
    as
    select *
    from schema1.test1
    insert into test_final
    select t2.* from schema2.test1 ,  test_final tf
    where t2.pk != tf.pk
    /...assuming duplicate primary keys mean duplicate records. If that assumption is not the case then you have a more complex data migration exercise on your hands and you need to figure out some rules to determine which version of the data takes precedence.
    Cheers, APC

  • Need to Merge an Adobe XML file with a normal PDF

    The problem...
    I have created an order form in Adobe LiveCycle Designer (pre-ES).  The customer's requirements force us to merge their purchase order (a flat standard PDF) with the order form I have created to get the complete PDF to bill with.  Previously we were using a form created in another software and printing to PDF to merge the 2 PDF files.  The thought process with creating a form in LiveCycle Designer was "Oh 2 PDF's we can just merge them" ... we were very WRONG.  And please don't suggest "Packaging" the files... it won't work for our processing system... we've already tried .
    What we know now (had we known it before we'd have never purchased the licensing for LiveCycle Designer to start with)...
    You can NOT merge a PDF that has XML in it with Adobe Proffesional.
    Temporary Solution...
    We know we can print to PDF and then merge the files... this gets us the result we need, but it takes longer to print to PDF from these XML files than it did from the previous versions of the order forms in created in other software.
    Is there another solution? 
    Plea for help!  The users that are forced to do the process of printing to file and merging are ready to riot and/or go back to the "other" software.

    Hello!
    There are a couple terms you can google:
    "PDF Concatenate Forms iText"
    "Merge XML data with PDF Forms"
    Concatenating PDFs means you join multiple forms together into one PDF.
    Did you need to merge, or concatenate the forms?
    Either way there are a couple of methods to do this programmably.
    iTextSharp (.NET)
    iText (Java)
    FDFToolkit.net (.NET)
    iText products are open source, and have a learning curve, and support is provided on a Open mailing list.
    iText products are free ($) but can cost you time and money to research the methods.
    Useful Links:
    http://www.fdftoolkit.net/
    Message was edited by: NKOWA

  • How can I merge data from a spreadsheet to a document that I can email on an iPad?

    I Am switching from a old pc to my new iPad Air 2 and need to run my eBay business from it. The last issue I am having is I need to pull data from the sales spreadsheet I download from eBay and put the data in a document that includes name, address, quantity, part number, sku etc. so I can email the order off. I used to use Mail merge in Microsoft word for this but t it doesn't look like the iPad version of Microsoft office does this. Any help is great thanks,

    newfie_74 wrote:
    No, she didn't disable it on her iPad.  I don't think she should have to (she doesn't want to, anyways).
    I said iphone not ipad.
    Have you called apple support?

  • Merge data and a PDF file?

    Hi,
    I´m trying to render/merge data into a PDF file using FormServer (7.0) and .NET. I notice that if I use the xdp version of the pdf, FormServer will return a pdf with the merged data. However, I cannot acomplish this if instead of a xdp file document I use a pdf file (dynamic 7.0 created with livecycle designer 8).
    This works:
    String sFormPreference = "PDFForm";
    String sFormQuery = "ExpenseClaim.xdp";
    This doesn´t woks:
    String sFormPreference = "PDFForm";
    String sFormQuery = "ExpenseClaim.pdf";
    Isn´t it possible to merge data directly into a PDF using FormServer. I rather use a pdf file instead of a xdp file, because, a xdp file will need to be converted to a PDF file. Thus it will spent more time accomplishing the merge.
    Thank you

    Try using PDFMerge as the transformation.
    Chris
    Adobe Enterprise Developer Support

  • Need to merge xml o/p from different sources to generate BIP Report from OA page

    Hi,
    Currently in our product Quoting , we are using many VO queries to generate the Report
    Now we have created one data template file to combine all VO queries to generate xml o/p
    The problem we are facing is that we didn't added Contracts VO query in our DT file so we need to merge
    xml o/p coming from DT file and Contracts VO and pass to Process Template XDO api to generate the report
    Please tell how to merge the xml o/p in OAF ?

    Thanks Shridhar for reply ,  you provided code for xml coming from two VO
    but I am having scenario where getting one xml o/p from data template file and seconf xml o/p getting from contracts api as -
    ByteArrayOutputStream l_docXML = new ByteArrayOutputStream(1024);
    // Here getting xml o/p from DT file
    l_docXML = (ByteArrayOutputStream)this.getDataTemplateXML(transaction,"ASO","ASOPD",parameters1,null);
    // Here getting xml o/p from contacts api
    ContractTermsXMLGenerator.writeXML(PrintQuote,
                        (OutputStream) l_conXML,
       true,
       documentType,
       new Number(params[8]),
       new Number("0"));
    // code to merge two xml into one xml m_docXML
    try{
                 if (l_conXML.size() > 0)
                      DOMParser dp = new DOMParser();
                      l_docIP = new ByteArrayInputStream(l_docXML.toByteArray()); 
                      dp.parse(l_docIP);
                      XMLDocument xDoc = dp.getDocument();
                      l_conIP = new ByteArrayInputStream(l_conXML.toByteArray());
                      dp.parse(l_conIP);
       XMLDocument cDoc = dp.getDocument();
       Node cNode = cDoc.getDocumentElement();
                      if (cNode != null)
                           Node xDocConNode = xDoc.adoptNode(cNode);
                           Node conData = xDoc.createElement("CONTRACT_DATA");
                           conData.appendChild(xDocConNode);
                           xDoc.getDocumentElement().appendChild(conData);
                         xDoc.print(m_docXML);
                         writeLog("GenerateCLMDoc::XMLMerge Complete");
               catch(Exception e)
           writeLog("GenerateCLMDoc:: Doc contract XML Merge - " + e.getMessage());
                      throw e;
        finally{
                        l_docIP.close();
                        l_conIP.close();
    Please check if it is correct code , do I need to change it with code provided by you
    can we chat over any messenger ?
    once again thanks for your reply

  • Merging data without set text framing - creating continuous, flowing/wrapping records

    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.

    OysterBoy84 wrote:
    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.
    Searching Google for "indesign script combine all stories" without quotes turns up a number of links. There's a link to InDesign Secrets that describes a free script that may solve your problem.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Merging data into clob

    Hi!
    Can someone tell me how can I merge data from one table in one clob?
    for example: I have table emp with columns id,name,iddept. Now I need those data in one clob column for each iddept.
    id name iddept
    1 jack 01
    2 joe 01
    3 inna 02
    4 blake 03and now I need 3 rows like
    id clob
    1 1jack012joe01
    2 3inna02
    3 4blake03Regards,
    drama
    I resolved my problem.
    Edited by: drama9346 on 8.11.2012 4:06

    There is a good library to create pdf from a java program or a servlet in this page:
    http://www.lowagie.com/iText/download.html
    It's easy to use and there are different examples. It also allow you create the pdf document on-line in the client.
    If you need some help me I have used it and I can send you an example if you need.

  • Merging data without MobileMe

    I have a MacBook, an iMac and a iPhone 3Gs. Currently, I use MobileMe to sync my calendars and contacts over all three devices, but it's time to renew and frankly, it's a bit above my budget.
    I know that if I want to merge things that I've entered into my iPhone, I can simply do a physical sync with the iMac (the computer that's holding all my iTunes) but I don't sync with the laptop/MacBook because 1) I don't want to confuse the phone and 2) it doesn't have any of my iTunes library. But I do need my contacts and my calendars to be merged, so I'm trying to figure out how to do that without having to physically type in any new data.
    Any tips?

    OysterBoy84 wrote:
    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.
    Searching Google for "indesign script combine all stories" without quotes turns up a number of links. There's a link to InDesign Secrets that describes a free script that may solve your problem.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Merging data without primary key

    hiii,
    I have 2 internal tables "it_final1" and "It_final_new" and i want to join both tables.
    both have same fields like BUKRS,GJAHR,SAKNR.
    for IT_FINAL1 i am using "BAPI_GL_GETGLACCPERIODBALANCES" FM to get data.
    now i need to merge this.
    Please explain ...
    i am using below logic for that.
    LOOP AT IT_FINAL_NEW .
      IF sy-SUBRC = 0.
        MOVE-CORRESPONDING IT_FINAL_NEW to IT_FINAL_DIS.
      ENDIF.
    read table it_final1 with key bukrs = it_final_new-bukrs
                                                 gjahr = it_final_new-gjahr.
    move-corresponding it_final1 to it_final_dis.
    APPEND IT_FINAL_DIS.
    ENDLOOP.

    Hi,
    Please try the following,
    *Looping at final_new which has all fields except gjahr
    LOOP AT IT_FINAL_NEW .
    *move wa to destination wa
    MOVE-CORRESPONDING IT_FINAL_NEW to IT_FINAL_DIS.
    *read internal table having balance value using common field
    READ TABLE IT_FINAL1 WITH KEY BUKRS =  IT_FINAL_NEW-BUKRS INTO WA.
    if sy-subrc = 0.
    *assign balance value to final destination balance field
    IT_FINAL_DIS-balance = wa-balance.
    *append the it
    APPEND IT_FINAL_DIS.
    *now u got the values from 2 internal tables
    endif.
    ENDLOOP.
    Hope this solves your problem.
    Regards,
    Meera

  • Reports - merging data columns in matrix

    Hi, 
    I need help with merging columns in matrix. I use MS SQL 2012. I need merge data columns, here is example:
    matrix:
    +-----------+----------+
    |               |  [time]  |
    +-----------+----------+
    |               |  [step]  |
    | [project] +----------+
    |               | [action] |
    +-----------+----------+
    current output:
    +-----------+----------+----------+----------+----------+
    |               |   00:00 |   00:05  |   00:10  |  00:15  |
    +-----------+----------+----------+----------+----------+
    |               |  step 1  |  step 1  |          |  step 2  |
    | project 1 +----------+----------+----------+----------+
    |               |  start     | running  |          |  start   |
    +-----------+----------+----------+----------+----------+
    |               |              |  step 1  |  step 1  |  step 1  |
    | project 2 +----------+----------+----------+----------+
    |                |             | start    | running  |  running |
    +-----------+----------+----------+----------+----------+
    demanded output:
    +-----------+----------+----------+----------+----------+
    |               |   00:00  |   00:05  |   00:10  |   00:15  |
    +-----------+----------+----------+----------+----------+
    |               |        step 1          |              |  step 2  |
    | project 1 +----------+----------+----------+----------+
    |                |  start    | running  |            |  start    |
    +-----------+----------+----------+----------+----------+
    |                |             |            step 1                     |
    | project 2 +----------+----------+----------+----------+
    |                |              | start    |       running       |
    +-----------+----------+----------+----------+----------+
    Thanks in advance :-)
    Regards

    Hi  Katamarucz,
    According to your description and the sample matrix, you want to merge the columns in the same steps into one column, right? In this case, on some rows the columns that have the same steps should be merged, however, the column should not be merge on other
    row that the columns have different steps. 
    In Reporting Services, if we merger the columns when designing the report, then the columns will be merged on all the rows. So you requirement cannot be achieved. And I am afraid there is no other approach to work around this issue.
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Merging data into PDF

    Hi,
    I am trying to merge data into PDF using FDF toolkit and seem to be having trouble viewing the document in IE 6.0. I tried setting the content type on the response to 'application/vnd.fdf'
    Would appreciate if i can get some input on this.
    Thanks.

    There is a good library to create pdf from a java program or a servlet in this page:
    http://www.lowagie.com/iText/download.html
    It's easy to use and there are different examples. It also allow you create the pdf document on-line in the client.
    If you need some help me I have used it and I can send you an example if you need.

  • Sending merging data source..

    Hello all..
    am new at jmf and i need some help,,, on fly i want to say that i have a web cam and i have a mic and i need to send the a merging data source of both the audio and vedio that i capture them from mic and camera to another pc using the RTPManeger concept.
    I see some codes that send an audioalone or vedio alone but i don't see what i need ( an access to a devices and merging there outputs and send them using rtp).
    Can any body help me How to do this application?? Please give me an example about what i need??
    Thanks for all..

    Is there anything obvious in this code clipping that I'm missing? I'm truely stumped, and my project is literally at the stage of "if this recording to file works, this milestone is complete".
    I want to help you here, and I think I have the answer to your question, but I am not sure that I understand your question completely.
    I will offer you this code:
    [ http://code.google.com/p/xomaya/source/browse/xomaya/src/xomaya/components/Xomaya.java?r=27|http://code.google.com/p/xomaya/source/browse/xomaya/src/xomaya/components/Xomaya.java?r=27]
    It solves the problem of p.getDataOutput() has no output. If I have misunderstood your question please let me know.
    S.

Maybe you are looking for

  • Move ASM disks with database from one server to another?

    I have a 11.2.0 ASM with a 11.2.0 database on two internal disks on server1. The disks are not in any raid or volume manager configuration, i.e. they are just two disks. The disks were physically removed from server1 and installed on server2, which i

  • Full screen gaming

    For some reason when I am playing games in fullscreen mode a random frame rate drop will occur. A typical scenario from world of warcraft is as follows. I am in a zone of the game levelling where the graphics are not too demanding. I am getting a smo

  • Can someone help me with a batch processing problem

    I just got my first Mac and I just loaded Aperture and unfortunately a deadline is upon me. I am used to Photoshop but I'm lost here looking at Aperture. All I need to do right now is to pop in CDs full of photos and produce thumbnails of them to put

  • Installing EBS R12 on Windows Vista Basic

    I am trying to install EBS R12 media pack on my computer having Windows Vista Basic. I could have the installation pass 2 steps out of 5. But while performing the third step, it is failing with the following error: Log file located at F:\oracle\VIS\i

  • HP Officejet Pro 8600 - Print Preview is not available

    I have a new HP Officejet Pro 8600 AIO printer that I purchased last week. I hooked it up to print in a network environment. I have thee window xp systems and three windows 7 systems printing to it with no issues.I am very happy with it. Yesterday my