Multiplex single row into multiple rows

Hi guys,
could you please help me with preparing a select statement.
Table sales:
product name transaction
x laptop 3
y mobile 2
z charger 4
consider we have the table structure as above.
i need a select query, that gives the result as below
product name transaction
x laptop 1
x laptop 1
x laptop 1
y mobile 1
y mobile 1
z charger 1
z charger 1
z charger 1
z charger 1
here the ransactions are divided into several records based on the transaction.
Thanks
Karthee

Hi Karthee,
Welcome to the forum !!!
Try this...
with xx as(
  select 'x' p,'laptop' n,3 t from dual union all
  select 'y' p,'mobile' n,2 t from dual union all
  select 'z' p,'charger' n,4 t from dual
select t1.p ,t1.n, 1 from (
   select p,n,row_number() over(partition by p,n order by p) rn from xx
     connect by level<=t) t1, xx
where rn<= xx.t and xx.p = t1.p;gives
o/p =
x     laptop     1
x     laptop     1
x     laptop     1
y     mobile     1
y     mobile     1
z     charger     1
z     charger     1
z     charger     1
z     charger     1Ranit B.
Edited by: ranit B on Nov 24, 2012 9:30 PM
-- added o/p

Similar Messages

  • Split Single IDOC into Multiple IDOC's Based on Segment Type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on Segment Type
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Segment 2
    Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.

    Thanks a lot Harish for reply.
    I have small doubt. According to your reply , If we have N number of segments in single IDOC with same fields in all segments then for splitting Single IDOC into Multiple IDOC's based on Segment Type we need to duplicate N number of target IDOC tree structure.
    Is that possible to Split single IDOC into Multiple IDOC's based on Segment Type using only one Target IDOC structure without duplicating the Target IDOC structure tree.

  • Splitting single video into multiple files - workflow improvements?

    I regularly need to split a single video into multiple separate files that are used by other programs.  I'm using Premiere Pro CS4 for a number of reasons including the ability to easily and accurately select a scene by individual frames, native audio and video effects/filters, and the ability to import and export various video types.  I'm open to using other tools, but I haven't yet found one that is even close to Premiere Pro when it comes to accurately selecting split points.
    I'm not a Premiere Pro expert.  I have been doing this for about four months and have read many resources (books, forum posts, help guides) to refine the workflow I'm currently using.  My question:  does anyone know any improvements that might save me time/keystrokes.
    Current workflow:
    I've bound F8 to File > Export > Media
    Import video file
    Open in source monitor
    Set In and Out points for scene in source monitor
    Ctrl-drag from source monitor to Project Panel (creates a subclip)
    Repeat 3 and 4 for all scenes/subclips
    Select all subclips from Project Panel and drag to timeline
    Set work area bar to first subclip in timeline by the following four keystrokes:  Home, Alt-[, PageDown, Alt-]
    Type F8 (File > Export > Media shortcut).  Type output file name, click OK and the first subclip is put in the AME queue
    For the remaining subclips, type: Alt-[, PageDown, Alt-], F8, output file name, OK and repeat until done
    Any thoughts/ideas on workflow improvements?
    Thank you!

    Thank you Hunt.
    For the sake of brevity, I didn't include all of the details about the various aspects of the projects.
    Early on I was doing what you suggested and yes, it is a little quicker.  I learned (painfully) a couple of months later that I sometimes have to go back and adjust the clips and this method (trim to timeline with no subclips) resulted in quite a bit of duplicate effort (to reobtain start/stop points).  I've since learned that managing the "scenes" as subclips in topical bins allows me to go back and make adjustments, long after I've totally forgotten about the project content, without a lot of unnecessary reworking.

  • Splitting the single record into multiple records based on validity

    Hi Guru's,
    basically i am an BI consultant with less knowledge on ABAP, can i request your help on the ABAP task.
    I am working on HR module which is integrated with SAP BI,  the reports will be executed based on calendar month the requirement is i should split the single record into a multiple records based on validity of the record.  basically the HR data would be in data from and date to. 
    below is the logic
    Check whether the start and end date of the record are in the same month and year.
    If yes  nothing changes
    If no  create multiple records
    1st record  original start date of the record u2018till end of that month
    Following record  1st of the next month  u2018till last day of the month
    u2026
    Last record  1st of the month u2018till original end date.
    All fields will have the same values, only the datefrom and dateto fields change.
    Can any one please provide me the same code to proceed on my task.
    Thanks and Regards,
    Venkat

    Hi,
    Using Rule group we can split it.
    Using Rule Group in SAP-BI  Part - 1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/using%20rule%20group%20in%20sap-bi%20%20part%20-%201.pdf
    Thanks
    Reddy

  • 8500 adf scan Breaking a single page into multiple pages

    I have a 8500A Premium. Lately when I am scanning multiple sheets via the ADF, the scan will take each sheet and break it into multiple sheets on the scan.  i.e., if I am scanning 5 sheets, I may end up with 20 partial sheets in my scan. 

    Hello there @coolhandluke2 ,
    I read about the unusual scanning issue you are facing when you scan with your Officejet 8500A. I would suggest trying a multiple copy for starters to see the copies will also show irregularities.
    If the copies work fine, the issue is most likely within the software.
    Here are some steps to try!
    Power reset:
    Press the Power button to turn on the product.
    With the product turned on, disconnect the power cord from the rear of the product.
    Unplug the power cord from the wall outlet.
    Wait at least 15 seconds.
    Plug the power cord back into the wall outlet.
    Reconnect the power cord to the rear of the product.
    If the product does not turn on by itself, press the Power button to turn it on.
    Uninstalling the Printer Software, restarting the computer and reinstall the printer HP Officejet Pro 8500A Premium e-All-in-One Printer - A910n Drivers
    Let me know the results, good luck!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • Can I export a single file into multiple files?

    Is there an option or a plugin that would allow me to set markers in the audio, and then have Soundbooth export the audio into multiple files?
    As an example, let's say I have a 1 minute audio file. I place a marker at 0:00 and another marker at 0:10 and a third marker at 0:30. I then would select Export Multiple and I would end up with three seperate wav files, one 10 seconds long, the second 20 seconds long and the last one 30 seconds long.
    Thanks

    Hi laforcej
    Open the PDF In Acrobat ...
    Go to Tools -> Pages -> Extract
    Now Select the Page Number you Want to Extract and Save them

  • Odi-row wise insertion of single source into multiple interfaces in package

    hi,
    i have an issue.My source table is emp(empno(pk),name,job,mgr,sal,deptno,comm).And my target tables are
    emp1(name,empnoa(pk),deptno),emp2(empnob(pk),job,sal).
    i have two interfaces: interface1----emp to emp1
    interface2-----emp to emp2.
    I have 100 rows in my source table.
    Requirement is :in my package i put interface 1 after interface 2.
    For each row of the sorce emp.The data should go into targets emp1,emp2.If a particular row isnt getting into either emp1 or emp2.That particular should rollback[i.e it should enter into either emp1 or emp2].
    The insertion should be row wise and not the whole of source data.
    How do i go about this?

    Perhaps this will work:
    Keep interface 1 as is - run it first in the package.
    for interface 2, join emp to emp1, only update/insert into target (emp2) if: emp.empno = emp1.empnoa - this way, you will not add anything to emp2 that is not in emp1.
    then, create a simple procedure to
    delete *
    from emp1
    where not empnoa in (select empnob from emp2)
    They may be a better solution, but this is easy and should work just fine.

  • Transformation Routine to convert single record into multiple

    All,
    I need your help with ABAP Syntax.  My requirement is to take a single record and convert it to multiple records into a DSO with a condition to not create a record if a KF value is 0.
    R/3 Data Record:
    Employee | Date | Char1 | KF1 | Char2 | KF2 | Char3 | KF3 | Char4 | KF4
    Conversion Result into DSO:
    Employee | Date | Char1 | KF1
    Employee | Date | Char2 | KF2
    Employee | Date | Char3 | KF3
    Employee | Date | Char4 | KF4 (This record will not be written if no value is in KF4)
    I have read about the result table in update rules, however within BI 7.0 Transformations I am unfamiliar as to where the RESULT_TABLE function applies.  Has this been replaced by the Expert Routine?
    Could any ABAP expert provide sample code as to how I would perform this conversion in a Transformation Routine?
    Thanks,
    David

    Thanks Alex for your response.
    I did find a solution to this as it turns out to be fairly simple, however I executed the routine as an Expert Routine instead of a Start Routine.  I was advised to do the transformation here.
    The basic concept is defined below:
    Loop at source_package assigning -kf2.
              Append result_fields to result_package.
           Endif.
    -- Kf3u2026  and so on
    Endloop.
    Basically the APPEND statement is used to create the additional records.

  • How do I setup Multiple Inputs on a single card into multiple tracks (devices) in Adobe Audition?

    With a single Audigy 2 Card, how do I setup to record from two of the inputs (line-in and mic) into separate tracks in Adobe Audition 1.5?
    I am trying to get the different inputs to list as different devices in Adobe Audition 1.5 so that I can record to multiple tracks simultaneously with different input.
    Is it possible?
    Any help is appreciated.
    Thank you

    I need to know the same thing when using an Audigy2 ZS Platinum Pro. Neither the users manual nor the website provide anything more technical than how to hook up speakers wires.
    If you cannot multitrack from the multiple inputs, is the IEE 1394 (firewire) port capable of 6 pin connection to a Yamaha digital mixer with an MLan digital I/O card. If so, will the 16in/16out from the MLan pass through and be recognized by Adobe Audition?
    Thanks

  • Split a single avi into multiple avi files?

    Hi there, totally new to PS Elements Premier 10.
    I have some VHS video tapes that I converted to AVI format.  I'd like to separate the videos into segments (ie; separate Christmas 1982 from Easter 1983) - and store them in multiple AVI files.  I tried to do this in MS movie maker, but that was taking forever.  I bought Premier Elements because I figured it should be easier; and it probably is, but I'm noob...
    I have split the video into the scenes I want.  I have added markers... but I am having trouble splitting the actual video into chunks of clips - ie; one big avi file would become 10 smaller avi files.  I am trying to watch these on a boxee box, so I do want the to be separate files - I dont want to do a "web dvd" output.
    I have tried this:
    I dont see export functions.
    I go to "SHARE" but it only lets me export to a single output.
    How can I do this?  It's for Christmas presents, so it's a little urgent - any help you can give me would be soooooo appreciated.
    thanks!

    Thanks everyone.  I ended up figuring it out - whether or not I did it the best / easiest / fastest way is up for debate
    I split the video into clips.
    Separated the clips into different timelines.
    "left aligned" all the clips in their respective timelines so they all start at 0:00 (just for simplification)
    Disable all clips / timelines (right click, enable = false)
    Enable the individual clip/timeline that I want to save
    Set up the work area bar so that it starts at 0:00 and ends at the end of the specific clip I enabled.  With the "snap top" functionality turned on, this is pretty easy. 
    Go to "SHARE" and configure my outputs
    Make sure that "Share Work Area Bar Only" is checked on the "Share" tab before committing
    It creates an avi of only the enabled clip, for the timeline I created.
    Important:
    Make sure you set the work area bar properly, or you'll have a 10 minute clip followed by 2 hours of blackness.... did that a few times ha.
    Make sure you click the "Share Work Area Bar Only" on the share tab - or the same will happen. 
    Thanks for the replies everyone - let me know if there is a better way to acheive this in PE10.
    Thanks!

  • How to use Power Query to load data from a single source into multiple tables

    Hi all,
    I have a requirement to load my data into three different data models using Power Query. Is that possible?
    My source is a SharePoint survey list, with similar questions like:
    1) Course lecturer - John Doe
    1a) The course was useful (rate 1 to 5)
    1b) The lecturer displayed good knowledge of topic (rate 1 to 5)
    2) Course Lecturer - Mary Brown
    2a) The course was useful (rate 1 to 5)
    2b) The lecturer displayed good knowledge of topic (rate 1 to 5)
    I would like to split the data into separate data models (one for John Doe; another for Mary Brown), so that I can compare the different lecturers. Other than running separate surveys for each of them, I thought of using Power Query to transform the data.
    Is it possible?
    Thanks.
    Regards
    GM

    Yes, this is possible.
    Start with a single query that returns you the data for all lecturers.
    Right-click on the "all lecturers" query in the queries pane, and choose Reference, once for each lecturer. This will create a query for each lecturer.
    Open the query for each lecturer and filter the data so that only that lecturer's results are visible.
    Click "Close & Load To..." for each lecturer's query  to load the data into the data model. This will create a data model table for each lecturer.
    If your question is more about how to transform such a survey list into a table that can be easily filtered, please provide an example of how the list shows up in Power Query.
    Ehren

  • Single File into multiple files

    Hi,
    I am working on scenario where I will be getting Header,Trailer and in between plant records.
    I will be picking file and need to create a new file for each plant.
    Do we require BPM for this? Can it be achieved in Message mapping only?
    If so how?
    Would appreciate your help.
    Regards,
    Chandra

    Chandra,
    Are u getting Header, Trailer, Plant records as different files from the source or in single file itself? If you are getting from different source then you need BPM. If you are getting single file and need to generate multiple output file then no need for BPM.
    To be more simple  N:1 or N:M then you need BPM.
    1:M then no need for BPM.
    Everything you have to do in the mapping part.
    raj.

  • Breaking up single Region into Multiple Regions

    Hi,
    I've a single region (a form) on a page and it has 30 fields and it does not look that great.
    So just from the UI perspective, I want to break up this 1 large region into smaller 3 regions. Is it possible?
    All the data comes from and goes into one table, so I want to change the UI and not the backend.
    Thanks for the help.
    -Hozy

    Well think about it - why can't you do this? There isn't a reason :-) There isn't anything particularly special about the form region in and of itself - the create form region wizard just a handy way to auto-generate your CRUD processes and buttons.
    Keep your original form region and create your additional regions as HTML regions (i.e. blank regions). When you redistribute your page items, they are still linked together, so to speak. You can still use the 'create' buttons etc from the original region (in fact, you can also move the controls around too if you like).
    As for the stop/start page item, all it really does is close off the html table and opens up a new one below - the effect of which is that any page items below are laid out without reference to the structure above it. I find it particularly useful if you have, say, a wide text area item or another item with a big label and then have maybe two or three smaller page items underneath - in normal circumstances, the little items would end up being horribly spread across the page, whereas with the stop/start item, they are laid out more effectively.
    Why not have a go at using the 'Drag and Drop' function - it becomes more clearer that way. Don't be afraid to experiment!

  • Automator workflow to TAR multiple files in a single directory into multiple TAR archives, in succession?

    Good afternoon,
    I have set up an automator service that TAR's a folder into an archive for me and it works quite nicely. Idealy however, I would like to be able to highlight several folders, right click and have automator tar each folder into it's own TAR archive, but do it one by one.
    Example:
    FOLDER 01
    FOLDER 02
    FOLDER 03
    Highlight all - Right Click - "TAR Folder" - Automator takes over at this point and TARs each one into:
    FOLDER 01.tar (Once complete moves onto:)
    FOLDER 02.tar (Once complete moves onto:)
    FOLDER 03.tar (Finished)
    I'm not 100% sure so I guess it would be a good time to verify, is there a problem with having the system try to TAR multiple folders at one time? If it is not a problem then I guess this discussion itself is pointless and I can simple right click on each folder and select "TAR Folder" and just wait until they're all finished. I would think that it would be ideal for the system to do each one individually and not try to do them all at one time.
    Any help would be appreciated.
    Thank you!!

    I don't think I have the following totally fleshed out but you probably can extrapolate on it.   This is a service which you can right click a set of folders  and it will tar the files within those selected folders with then file names "name xxx.tar", where name is the tar'ed file/folder and xxx is a count within the folder.
    I think that is what you originally specified so I am a bit confused by your script with the bit about Archive.tar. 
    Anyway here the basic idea:
    I ran the script directly with a folder argument just to see it indeed tar's up all the stuff inside, one tar per item.

  • Split single transaction into multiple PDFs

    I have a single XML file that contains a form that overflows multiple times. I want each form to be treated as a separate transaction (i.e. I want each form to generate a separate pdf).
    From the FSISYS:
    < ExtractKeyField >
    SearchMask = 1,<Wrapper
    I want each of these Address Changes to result in a separate PDF.
    <Wrapper>
    <ProducerConfirmations beginTime="0001-01-01T00:00:00" endTime="0001-01-01T00:00:00" emailChange="true" nyFlag="NA">
    <AddressChange previousAddressId="ResidentAddr_Old" addressId="ResidentAddr" mode="email" responsys="e0740ace1f534391b464b03707874636" addressType="Residential" />
    <AddressChange previousAddressId="BusAddr1_Old" addressId="BusAddr1" mode="email" responsys="e0740ace1f534391b464b03707874636" addressType="BusinessAddress1" />
    <AddressChange previousAddressId="BusAddr2_Old" addressId="BusAddr2" mode="email" responsys="e0740ace1f534391b464b03707874636" addressType="BusinessAddress2" />
    <AddressChange previousAddressId="BusAddr3_Old" addressId="BusAddr3" mode="email" responsys="e0740ace1f534391b464b03707874636" addressType="BusinessAddress3" />
    <AddressChange previousAddressId="BusAddr4_Old" addressId="BusAddr4" mode="email" responsys="e0740ace1f534391b464b03707874636" addressType="BusinessAddress4" />
    </ProducerConfirmations>
    </Wraper>
    Any way I can force the PDF print driver to produce each page as a separate file?
    Muchas gracias,
    Dave

    You'd need to use class recipients and make this node the address field. There is not an other way to split at the transaction level.

Maybe you are looking for