Need to Insert 2 Fields into one Destination Field

I have a scenario in this way:
Source Table  
Inventory
Alocation| Blocation
ABC         DEF
Destination Table
LocationID
Mapping Table  
LocationID, Location
1               ABC
2               DEF
Now I have to write a query wherey both the location codes should be inserted into LocationID in Destination table
Normally If one Location was available I would have inserted, but I need to insert both the Records into Destination by mapping them to Mapping table
if one Location Was Available:
Insert Into DestinationTable
(LocationID)
Select M.LocationID From MappingTable M Join Sourcetable S Where M.location = S.ALocation
This would Output
Destination Table
LocationID
1
But I want to see this as 
Destination Table
LocationID
1
2
Please Help on this.
Thanks
Thanks, Please Help People When they need..!!! Mark as answered if your problem is solved.

Check out UNPIVOT:
http://www.sqlusa.com/bestpractices/training/scripts/pivotunpivot/
http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • I need to insert an eof into a string

    I am using RandomAccessFile and I need to insert an EOF into a String manually. Any tips on how to do this? Here is a snippet of the code.
    origF.seek(0);
    replacement = "The stuff I want in the file.";
    replacement = replacement + ??????;  //(to indicate an EOF for the file)
    origF.writeBytes(replacement);
    origF.close();

    I found my way. Take a look in this piece of code.
        vlWrite.seek( vlPresentEntryPoint );  // position the file
        vlWrite.writeBytes( vpNewString );    // writes the new string
        vlWrite.writeBytes( vlSavedData );    // writes remaing file content
        vlWrite.setLength( vlFileLength );    // redifines file length
        vlWrite.close();I'm planning to share my code(s) in the forum. But me first make a concerning question. I'm new in Java and came to this forum to find and give help when I can. But, it is a forum where people wants to help and share or what ?????
    JJLobo

  • Need to concat multiple elements into one element

    Hello, here is my challenge:
    Query:
    SELECT  XMLROOT (
            XMLELEMENT ("Inv",
                             XMLAGG (
                                        XMLELEMENT ("Invline",
                                                     XMLELEMENT ( "Category", i.category ),
                                                    XMLELEMENT ( "Amount", i.amount ),
                                         ), VERSION '1.0', STANDALONE YES).EXTRACT ('/*')
      FROM (
            SELECT 1 AS inv_no, 'Labor' AS category, 5 AS amount FROM DUAL
                UNION ALL
            SELECT 1, 'Out-of-Pocket', 10 FROM DUAL
                UNION ALL
            SELECT 1, 'Travel', 20 FROM DUAL
                UNION ALL
            SELECT 1, 'Travel', 2.5 FROM DUAL) i;
    Returns:
    <?xml version="1.0" standalone="yes"?>
    <Inv>
      <Invline>
        <Category>Labor</Category>
        <Amount>5</Amount>
      </Invline>
      <Invline>
        <Category>Out-of-Pocket</Category>
        <Amount>10</Amount>
      </Invline>
      <Invline>
        <Category>Travel</Category>
        <Amount>20</Amount>
      </Invline>
      <Invline>
        <Category>Travel</Category>
        <Amount>2.5</Amount>
      </Invline>
    </Inv>
    Required:
    <?xml version="1.0" standalone="yes"?>
    <Inv>
      <Inv_No>1
        <Details>Labor 5
      Out-of-Pocket 10
      Travel 22.5
      </Details>
      </Inv_no>
    </Inv>
    So I would like help combining the details into one field for transmission to the Mexican Tax Authorities( their spec calls for all  invoice lines to be concated together).
    Note that there are two travel details that need to be summed as well.
    I would prefer to cannot change the query if possible, just using the XML functions.
    Thanks!

    And your db version is?
    From 11.2 and onwards, you can use LISTAGG aggregate function to concatenate character data across rows :
    SELECT XMLElement("Inv"
           , XMLAgg(
               XMLElement("Inv_No"
               , v.inv_no
               , XMLElement("Details"
                 , listagg(v.category || ' ' || to_char(v.amount), chr(10))
                     within group (order by v.category)
    FROM(
        SELECT t.inv_no
             , t.category
             , sum(t.amount) as amount
        FROM (
          SELECT 1 AS inv_no, 'Labor' AS category, 5 AS amount FROM DUAL UNION ALL
          SELECT 1, 'Out-of-Pocket', 10 FROM DUAL           UNION ALL
          SELECT 1, 'Travel', 20 FROM DUAL            UNION ALL
          SELECT 1, 'Travel', 2.5 FROM DUAL
        ) t
        GROUP BY t.inv_no, t.category
    ) v
    GROUP BY v.inv_no ;

  • I need to insert a table into my form.  Anyone know how to do this?

    I'm trying to figure out how to insert a table into my current form.  I can't seem to locate any button or instruction on how to do that.  Any and all help is greatly appreciated. 

    I'm guessing you're using the free version. I would first try to import a table from another PDF file. If that doesn't work I would try using the "add item" feature for either the "text" or "email" fields because those are formatted as 2 columns. You will just have to manipulate them how you want them.
    Good luck!

  • In PSE8 I need to move some files into one file - how to do?

    When I added some photos of a trip from my camera to my PSE8 Organizer instead of going in as one file by date loaded they went in under separate files names. Now I have a large amount of files and want to move them into one file. How do I make a new file that I can move them to and how do I move them? Do I do this in photoshop or do I do this in windows My Pictures. I am using Win7.

    Can you give me a little more info please. When I click on the display button it shows some dropdown menus, what do I click on next? What left hand panel do you mean? I'm always nervous about clicking on things in PSE, it usually ends up changing everything around then I spend hours trying to get everything back to how it was. Thanks.

  • Need help fast! Need site to merge documents into one pdf

    I pay a monthly fee to adobe so I can merge different files together into one pdf. I just logged in for the first time this semester, and all I see are different products adobe wants me to buy. How do I find the site to merge the documents? I have less than 3 hours till I have to submit, please help!

    If you subscribed to PDF Pack, go to http://createpdf.adobe.com/
    If you subscribed to Acrobat Pro, download and install it.
    If you subscribed to Acrobat Plus, do either.
    Otherwise you probably have the wrong subscription.

  • I need to insert my photo into an external website but it needs to be reduced in file size from 4.4 to 2mb can anyone help..

    Hi, I need to insert my photo onto a profile page of an external website.  Trouble is that the jpeg file is 4.4 and it needs to be reduced to 2 mb.  I have tried everything that I can think of but nothing has worked.  I'm not very computer confident, so if anyone can support me on this, I'd welcome the help.

    Open the photo in the Preview application and click Save As... in the File menu. Its size will be indicated near the bottom of the resulting dialog box. Move the quality slider until the size you need appears, name the new file and select the location where you want to save it, and click the Save button.

  • I NEED HELP ON COMBINING FILES INTO ONE PDF FILE

    HOW CAN I TAKE 6 FILES AND MAKE THEM INTO ONE PDF FILE?

    Hi GOLDENSOROR
    How to merge files into one PDF:
    Within Acrobat XI, select File > Create > Combine Files into a Single PDF.
    Click Add Files and select the files you want to add.
    Click, drag, and drop to reorder the files and pages. Double-click on a file to expand and rearrange individual pages. Press the Delete key to remove unwanted content.
    When finished arranging the files, click Combine Files.
    Select File > Save As > PDF.
    Name your PDF file and click Save.
    Please refer : http://www.adobe.com/products/acrobat/merge-pdf-files.html

  • Import 2 source fields into one destination field (appending entries)

    Dear forum members,
    In MDM Import Manager, is it possible to take 2 fields from the source file structure and map the values to the same destination lookup field, so both values are appended to the table for the same record?
    If so, can you provide detaiuls and considerations?
    I have been looking at partitions, but all I can do is create a single record in the lookup table consisting of both values combined.
    Many thanks,
    Nick

    Hi Alon,
    Yes the field I am testing with is called 'Hyperlink' of type 'Lookup [Qualified Flat] (multi-valued)'
    The field shows as type 'F' in the destination field pane.
    I do acrtually want to load to a different field eventually, but am just testing with this as it seems to be the riight type.
    The table I want to load to is the Hyperlinks table in SRM-MDM. It has the following structure in the console:
    Field Name        Field Type       Non-Qualifier / Qualifier
    Type                 (Lookup[flat])    Non-qualifier
    Mime Type        (Lookup[flat])    Qualifier
    URL                  (Text)              Qualifier
    URL Description (Text)              Qualifier
    In import manager, the fields available are:
    Hyperlink                                F    Lookup [Qualified Flat] (multi-valued)
    Mime Type <Hyperlink>           Q   Lookup [Flat]
    URL <Hyperlink>                     Q  Text[250]
    URL Description <Hyperlink>    Q  Text[250]
    Ultimately I am trying to map:
    1. Hyperlink          - a null source value to a fixed dest value of 'Link'
    2. Mime Type        - a null source value to a null dest value
    3. URL                  - 2 values from 2 fields in the source file to 2 (appended) entries
    4. URL Description - same 2 source values in the source file to 2 (appended) entries
    Unfortunately we cannot modify the hyperlinks table or use a different one as the fields will not be displayed properly in the catalogue view SRM requisitioners will have so I HAVE to use this table and these fields.
    What do you think?
    Thanks a lot,
    Nick

  • Complete newbie needs help inserting flv file into DW

    This is a multi-part message in MIME format.
    ------=_NextPart_000_0015_01C98602.377A5370
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    I'm having a challenge today. A client sent me two flv files.
    When I =
    installed CS4 I installed Flash for the first time so I'm
    thinking, no =
    problem. But I'd never opened it before (never needed it
    until now). The =
    app won't open. I just spent a ton of time uninstalling and
    reinstalling =
    and rebooting over and over and nothing...
    So MAYBE, for now, I don't need it to work. I've also never
    insterted =
    Flash into DW. But it looks easy enough. In my html page I
    choose =
    insert/media/flv. So far so good. I've ftp'd the flv file so
    I'm able to =
    complete the dialog box with the path and size etc. I've
    uploaded the =
    progressiveplayer.swf and the chosen skin swf. I've saved the
    html file =
    it's embedded in and uploaded it. Shouldn't I now be able to
    see this =
    flv file displayed on the page? What did I miss? Here's the
    link to my =
    little test...
    http://www.susanhowlett.com/assets/applets/susan-movie.html=20
    The flv file is mm_susan_thanks.flv=20
    Thanks for any insight/guidance.
    Sheila
    ------=_NextPart_000_0015_01C98602.377A5370
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    charset=3Diso-8859-1">
    <META content=3D"MSHTML 6.00.6001.18183"
    name=3DGENERATOR>
    <STYLE></STYLE>
    </HEAD>
    <BODY bgColor=3D#ffffff>
    <DIV>
    <DIV><FONT face=3DArial size=3D2>
    <DIV><FONT face=3DArial size=3D2>I'm having a
    challenge today. A client =
    sent me two=20
    flv files. When I installed CS4 I installed Flash for the
    first =
    time so I'm=20
    thinking, no problem. But I'd never opened it before (never
    needed it =
    until=20
    now). The app won't open. I just spent a
    ton of time =
    uninstalling and=20
    reinstalling and rebooting over and over and
    nothing...</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>So MAYBE, for
    now, I don't need it to =
    work. I've=20
    also never insterted Flash into DW. But it looks easy enough.
    In my html =
    page I=20
    choose insert/media/flv. So far so good. I've ftp'd the flv
    file so I'm =
    able to=20
    complete the dialog box with the path and size etc. I've
    uploaded the=20
    progressiveplayer.swf and the chosen skin swf. I've saved the
    html file =
    it's=20
    embedded in and uploaded it. Shouldn't I now be able to see
    this flv =
    file=20
    displayed on the page? What did I miss? Here's the link to my
    little=20
    test...</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2><A=20
    href=3D"mhtml:{2BC949A9-CCEB-407F-8078-5F999C2CADAA}mid://00000013/!x-usc=
    susanhowlett.com/assets/applets/susan-movie.html</A>=20
    </FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>The flv file is
    mm_susan_thanks.flv =
    </FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>Thanks for any =
    insight/guidance.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Sheila=20
    </FONT> </DIV></FONT></DIV></DIV></BODY></HTML>
    ------=_NextPart_000_0015_01C98602.377A5370--

    From my little knwledge, it is not possible to insert FLV
    file in the HTML page directly.For this you have to made a player
    with flash which plays the FLV.And this swf can emdded in the HTML
    page.
    You can also download free flash videoplayers like JW Player.
    Thanks

  • Need help inserting flash movie into article...

    I inserted video into flash movie. I loaded the .swf & .fla files onto a server and went into the properties in the flash movie and pointed to the server to pull the .fla file & the movie controls .swf file.  I can preview the movie in flash with no problem.
    I am wanting to use the object code that was created as part of the .html file that was generated by flash and insert this into an article to display the video.  I path the .swf file in the object code to point to where it resides on the server but the video will not play using just the object code. Is there a way to do this using just a object or embed code without the need for scripts?
    (I am using CS4 version)

    If the swf file does not reside in the same folder as the html page that loads it, then if the video is dynamically loaded into the Flash file, chances are the targeting in the swf needs to be adjusted.  If the swf files just targets the video by its filename alone, try putting the video file in the same folder as the html file and see if it gets loaded.

  • Help needed regarding insertion of data into oracle

    Hi,
    I am student currently trying to do a project to up a semantic database using oracle. Have set up the semantic technologies for oracle 11gr2 and used the jena adapter to load an owl into oracle.
    But i am not sure how do i insert sample data that could reference the owl.
    Tried searching but unable to find any simple tutorial and have also looked through the developer's guide and also jenaadaptor guide.
    Is there any tutorials available that could help? thank you

    Hi,
    Please go to the OTN site for more information:
    http://www.oracle.com/technology/tech/semantic_technologies/index.html
    There you can find some training info (try the NCI Oracle By Example, it's a good tutorial):
    http://www.oracle.com/technology/tech/semantic_technologies/htdocs/semtech_training.html
    Regards,
    Vladimir

  • What File format do I need to insert a Video into a Powerpoint?

    HI...
    Trying to get a video inserted into a power point.  Am having a horrible time....Anyone know how to do this??

    http://www.microsoft.com/mac/support

  • Need to restrict the form into one page with out second page in SAP Script

    Hello Friends,
    I have a query in SAP script form, I had created one form for confirmation request for FI, i had copied the standard form F130_CONFIRM_01 and made the changes as per the requirements and checked in f.17 which was perfect. I had removed all the lines except wherever the changes i had made in the form.
    Here iam getting one problem, when iam printing the confirmation request it should give me in one page but here iam getting two pages of which one page iam getting the complete information and the second page iam getting the empty page.
    It should not give the second page. i also checked by giving the condition if &page& eq 1  but no difference iam getting two pages.
    Pl. let me know how to solve this problem since this is very very emergency issue.

    Hi Mark,
                  If i am not wrong is this Tcode for customer/vendor balance confirmation? In the standard script that u mentioned, the first page id the letter, and the second page contains the balance sheet.You would not be able to restrict the blank pages from coming, coz there are in all three scripts configured for the TCode F.17, so the blank pages are bound to come, even if the conditions for pages are maintained. I have faced similar problems in my development too....
    Thanks & Regards
    Nayan
    SAP Consulatant.
    Reward with points if useful

  • How to configure GG to merge two source tables into one destination table?

    I have two tables at source (say S1 & S2), I want to merge these tables and replicate to a single target table (Say T1).
    Does GG support this type of replication? If so, could any one let me know how to configure Table and Map parameters?
    Thanks in advance.

    It is possible. In the extract capture both the tables.
    Extract parameter
    table s1;
    table s2;
    Replicat parameter
    map s1, target t1, keycols (...);
    map s2, target t1, keycols (...)

Maybe you are looking for

  • How can i get Mac to read a certain type of file?

    i will cut to the chase i have some files from a voice recorder on a WINDOWS pc i stick a 512 mb flash drive in the windows pc's usb slot now i got the files on the flash drive i stick the flash drive into the Mac Minis Usb slot it shows the files bu

  • [Solved] Permission denied for imgs in apache home folder

    Hi, I'm getting 403 error when trying to open a captcha image with the browser (generated by codeigniter PHP framework  with captcha helper and Tank Auth library) the imgs are created with the http owner with permission "-rw-r--r--" inside a captcha

  • System.out will not flush before input

    Hello everyone, I am using Netbeans 5.5, JDK6, and J2EE. I am new to the environment so I wrote a test application that would prompt a user to enter a string and then echo it. I have: String str = ""; BufferedReader br = new BufferedReader(new nputSt

  • New opera mini 6.5 text arrangement problem.

    Hi, New opera mini 6.5 is not formatting web pages correctly to the display for some websites in portrait mode. Any ideas? Website for example- MyNokiablog.com. -------------------If this post helped you, click on accept as solution.-----------------

  • Layer 0 exceeds max when formatting?

    Please help. I don't know DVD studio pro so well, but I am trying to burn a DVD with a lot of menus and I get this message popping up: "Formatting was not successful. Layer 0 exceeds the maximum layer size allowed. Please choose a suitable marker loc