Retrieve of data from two columns into one column

For eg: i have a data in a table with columns A & B of same size
A B
1 2
2
3 1
4 2
5 3
6 5
7 1
8 4
9
10 8
Through a select i want the output of my data in one single
columns, Well I can do this by using union.
But my output should be like
if I select by condition where A=2
my output should be
2
1
3
7
4
because all these numbers are linked with 2 how do i do this
because it is like searching the number 2 in two columns and wherever this number 2 is linked i should get all the data relevant to it.
Hope u got my point what i exactly want
Can anyone help me it is quite urgent.
Regards
Vamsi Mohan

i do not a concatenated data
i have a data in a table with columns A & B of same size
A B
1 2
2
3 1
4 2
5 3
6 5
7 1
8 4
9
10 8
if my where condition is 'where A=2'
my output should be
1
2
3
4
5
6
8
10
i want my query to search as loop so that it keeps on searching
for related data as in my case it is
2 is linked to 1
1 is linked to 3
3 is linked to 4
my query should keep on seaching for linked numbers till
it does not find any mathing linked numbers
and the resulted output should come in one single column

Similar Messages

  • Retrive data from two tables into one internal table.

    Hi SDN,
    I am downloading the Assets data from two tables ANLA,ANLZ.
    there is a common field ANL1in both tables and i have to retrive the data by using anl1 into the internal table.
    can you please send me the SELECT Syntax for this probl.....
    Thank you & Regards,
    Manoj

    Hi manoj,
    Please see the following sample code. But kindly don't use join as it may hamper ur performance. No trouble in using two select query.
    data: begin of itab occurs 0,
            BUKRS like anla-BUKRS,
            ANLN1 like anla-ANLN1,
           BDATU like anlz-BDATU,
            end of itab.
    select anlabukrs anlaANLN1 anlzBDATU  into corresponding fields of table itab from anla inner join anlz on anlaanl1 eq anlz~anl1 where (logexp).
    Please come back for any clarification.
    Thanks and Regards,
    saurabh

  • How to combine data from two rows into one row

    I have the following sets of data. I want to find all the duplicate sets of field values. in the data below there is only one duplicate set: brenda, analyst, green.
    DocID and Doc Seq combine to form the set key. FieldID I believe are consistent in that 1 is always name, 2 is job, 3 is favorite color etc. but there are up to 20 field IDs.
    To tell you the truth, my client is a bit sketchy about the data and the values. I would like collapse the sets by getting all the field values into a single row. They could be in the same column, or in their own columns. This way I can then look for whatever
    dups my customer seems to think that he has.
    the first image is what i want (either in same column or in different columns. but they have to be in the order of the FieldID), the second is what i have. THANKS

    CREATE TABLE #t (
    c1 INT NOT NULL PRIMARY KEY,
    c2 VARCHAR(50) NOT NULL
    GO
    INSERT INTO #t(c1, c2) VALUES(1, 'P1,P2,P3')
    INSERT INTO #t(c1, c2) VALUES(2, 'P2,P3')
    GO
    -- Generate set of numbers
    -- Idea from Itzik Ben-Gan
    ;WITH
    L0 AS (SELECT 1 AS n UNION ALL SELECT 1),
    L1 AS (SELECT 1 AS n FROM L0 AS a, L0 AS b),
    L2 AS (SELECT 1 AS n FROM L1 AS a, L1 AS b),
    L3 AS (SELECT 1 AS n FROM L2 AS a, L2 AS b),
    L4 AS (SELECT 1 AS n FROM L3 AS a, L3 AS b),
    Numbers AS (SELECT ROW_NUMBER() OVER(ORDER BY (SELECT 1)) AS Number FROM L4)
    SELECT
    t.c1,
    t.c2,
    SUBSTRING(',' + t.c2 + ',', Number + 1, CHARINDEX(',', ',' + t.c2 + ',', 
    Number + 1) - Number - 1) AS Item,
    ROW_NUMBER() OVER(PARTITION BY t.c1 ORDER BY n.Number) AS rn
    FROM
    #t AS t, Numbers AS n
    WHERE
    n.Number <= LEN(t.c2)
    AND SUBSTRING(',' + t.c2 + ',', n.Number, 1) = ','
    ORDER BY
    t.c1, rn
    GO
    DROP TABLE #t
    GO
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How do I merge my Mail data from two Macs into one?

    One is Lion and the other is Mountain Lion, both 27" iMacs. I have saved the Mail data from the Lion one and will reformat its HDD for a clean install of Mountain Lion.  Then I plan to import a (CCC) clone of my newer iMac.  I need to merge the mail because some mail items are missing on the clone that existed on the erased iMac.

    Copy or move the song files from one account to a shared location and then drag them into the open iTunes window when logged into the other account.
    (60844)

  • HT1449 how do you move all music from two computers into one itunes account?

    How do you move all music from two computers into one itunes account?

    An "iTunes account" is an online account you use for buying music, like a bank account.  An iTunes collection is the media you see when you open iTunes. Which do you mean?
    If it is two computers, it would also help to know where these are located. Are they on the same local network? If they are, try Home Sharing (and you have control of both and you aren't just trying to get music fro your computer to your friend's computer in another state).  If they are not, you'll have to use an external hard drive or flash drive.
    Is this on a PC? Your computer information says Windows but you posted this in the iTunes for Mac forum.

  • How to upload the data from two sheets in one excel into SAP

    Hi experts,
                    My requirement is to upload the data from two sheets in an excel into an internal table.How can this be achieved.Is some OLE application has to be used?
    Thanks
    Abhishek

    Hi
    see this program will upload excel file to application.
    *& Report  ZSD_EXCEL2
    REPORT  ZSD_EXCEL2.
    types: begin of ttab ,
          fld1(30) type c,
          fld2(30) type c,
          fld3(30) type c,
          fld4(30) type c,
          fld5(30) type c,
          end of ttab.
    data: itab type table of ttab with header line.
    selection-screen skip 1.
    parameters: p_file type localfile default
                'C:\test.xls'.
    selection-screen skip 1.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
    start-of-selection.
      clear itab. refresh itab.
      perform upload_data.
      loop at itab.
        write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
      endloop.
    * Upload_Data
    form upload_data.
      data: file type  rlgrap-filename.
      data: xcel type table of alsmex_tabline with header line.
      file = p_file.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = file
                i_begin_col             = '1'
                i_begin_row             = '1'
                i_end_col               = '200'
                i_end_row               = '5000'
           tables
                intern                  = xcel
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      loop at xcel.
        case xcel-col.
          when '0001'.
            itab-fld1 = xcel-value.
          when '0002'.
            itab-fld2 = xcel-value.
          when '0003'.
            itab-fld3 = xcel-value.
          when '0004'.
            itab-fld4 = xcel-value.
          when '0005'.
            itab-fld5 = xcel-value.
        endcase.
        at end of row.
          append itab.
          clear itab.
        endat.
      endloop.
    endform.

  • Combine the data of two DSOs into one

    Hello experts,
    how to load the data of two DSOs into a single one using transformations and DTPs?
    Example:
    DSO A keyfields: X,Y,Z / attributes M,N,O
    DSO B keyfields: X,Y,Z / attributes P,Q
    DSO C keyfields: X,Y,Z / attributes M,N,O,P,Q  (result should be a single data record!)
    In the transformation between DSO A and C I map all keyfields and attributes M,N,O (no mapping for P and Q, meaning no transformation rule). For B to C mapping is all keyfields and attributes P, Q (no mapping for M,N,O, no transformation rule).
    When I now load the data of DSO A and DSO B to DSO C I either see the attributes M,N,O or P,Q. This means that only the latest DTP is available and overwrites the attributes with blank values of the first DTP.
    I have a solution using ABAP coding but according to the SAP Training courses (BW330) it should work without using ABAP coding.
    Any help is highly appreciated.
    Thanks in advance.
    Marco

    Hi Marco,
    Thanks again
    I looked into BW330 Business information warehouse - Modelling.
    Course version : 2006 Q2
    Material number : 50079531
    I looked into the page 281 still no luck.
    just an overview i need to create X,Y,Z,M,N,O as info objects characteristics
    and P, O  as infoobjects keyfigure.
    None of them will have attributes and i load XYZMNO to DSO1 and same XYZPO to DSO2.
    Then map DSO1 - DSO3 and  DSO2 - DSO3 and carry out the steps to get the data from DSO1 and DSO2 to DSO3.
    Am i right.
    Regards,
    Harish

  • SSAS Tabular - Merge data from two tables to one

    Hi,
    I have two ReportServer databases in two different instances of SQL Server. I want to extract the ExecutionLog3 data to a Tabular model. Now, I have two separate tables in Tabular with duplicated measures but I want to have the data from two ReportServer in
    the same table.
    Any idea?
    Regards.

    Hi Numero4,
    According to your description, there are two Reporting Services databases, and you want to merge the data in a tabular model, right? 
    As per my understanding, you can create a link server on one of the server, and then merge the data in database lever other than in tabular mode. In this case, import the merged data into the tabular model. Here are some useful links for you reference.
    http://msdn.microsoft.com/en-IN/library/ff772782.aspx
    http://support.flexquarters.com/esupport/index.php?/Default/Knowledgebase/Article/View/2458/52/how-to-create-link-server-with-ms-sql-200520082012-64-bit-using-qodbcqremote
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to fetch data from different sources into one source (like into Ztable)

    hi friends,
    As per our client requirements they want to develope an Inventory and an Ontime delivery report in BO on top of Oracle database.
    Situation is some thing like they have ECC 6.0.and they want to collect all inventory and ontime delivery data at one place.According to me that could be one Ztable in which we can gather all data.Apart from that they are going to use Data Integrator in which they can directly fetch the data from R/3 system(They dont want to have BI system) and put all data in Oracle DB.On top of ORacle BO person can develop BO reports.
    My question is how to fetch all data at one place and what are the tables going to be use.
    kindly help me out as its very important project.
    Thanks
    Abhishek

    The following is my standard reply to those who need to get old data from a backup in one account and add it to another account.  The method described here may be applied to your case.  It would be a bit of a long process, though.
    When connected to the account you want to GET data from, Go to Settings>iCloud and turn all data that is syncing with iCloud (contacts, calendars, etc.) to Off. 
    When prompted choose to keep the data on the iPhone. 
    After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using a different Apple ID and turn iCloud data syncing for contacts, etc. back to On.  When prompted, choose Merge.  This will upload the data to this new account.
    Note that this only affects the "Apple data" like contacts, calendars, reminders, etc.  Many third party apps also use iCloud to store data files there.  These files may be lost in the process, unless the apps also keep the data locally on the device.
    NOTE:  Photos in the photo stream (if you use it) will not transfer to the new account.  It is advised that you save the photos to a computer before performing the account switch. 

  • Collecting data from multiple rows into one column

    I'd like to run a query and put a collection of items into one output column instead of multiple rows. See the example below:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
    PL/SQL Release 10.2.0.5.0 - Production
    "CORE     10.2.0.5.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
         CREATE TABLE "SKIP"."INGREDIENTS"
       (     "INGRED_ID" NUMBER,
         "INGRED_NAME" VARCHAR2(20 BYTE),
         "STORES" VARCHAR2(20 BYTE)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.INGREDIENTS
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (1,'SEA SALT','Food lion');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (2,'TABLE SALT','Food lion');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (3,'FLOUR','Piggly Wiggly');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (4,'YEAST',null);
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (5,'BEER','ABC Store');
      CREATE TABLE "SKIP"."PRETZELS"
       (     "PRETZEL_ID" NUMBER,
         "PRETZEL_NAME" VARCHAR2(20 BYTE),
         "PRETZEL_DESC" VARCHAR2(100 BYTE)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.PRETZELS
    Insert into SKIP.PRETZELS (PRETZEL_ID,PRETZEL_NAME,PRETZEL_DESC) values (1,'CLASSIC','Classic knot pretzel');
    Insert into SKIP.PRETZELS (PRETZEL_ID,PRETZEL_NAME,PRETZEL_DESC) values (2,'THICK STICK','Straight pretzel, abt 1/2" in dia');
      CREATE TABLE "SKIP"."INGRED_XREF"
       (     "PRETZEL_ID" NUMBER,
         "INGRED_ID" NUMBER
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.INGRED_XREF
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,1);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,2);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,4);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,2);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,3);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,5);
    --  Constraints for Table INGRED_XREF
      ALTER TABLE "SKIP"."INGRED_XREF" MODIFY ("PRETZEL_ID" NOT NULL ENABLE);
      ALTER TABLE "SKIP"."INGRED_XREF" MODIFY ("INGRED_ID" NOT NULL ENABLE);
    {code}
    Desired output (note how the ingredients are all listed in one column, separated by commas):
    {code}
    PRETZEL_ID PRETZEL_NAME     PRETZEL_DESC                        INGREDIENTS
    1          CLASSIC          Classic knot pretzel                SEA SALT, TABLE SALT, YEAST
    2          THICK STICK      Straight pretzel, abt 1/2" in dia   TABLE_SALT, FLOUR, BEER

    See the FAQ : {message:id=9360005}
    Especially links concerning string aggregation.

  • Unable to consolidate data from two DSOs into an InfoCube for reporting.

    Hello Experts
    I am working on BW 7.0 to create BEx Report as below:
    This report will have data coming from two different sources, some data from COPA DSO [such as Customer Number, Product Hierarchy1, Product Hierarchy2, Product Hierarchy3, Product Hierarchy4. Product Hierarchy5, Product Hierarchy6 and a few other Key Figures] and the rest [such as Product Hierarchy, Reference Document, Condition Type (both Active & Inactive), Condition Value and a few other Key Figures] from another DSO (ZSD_DS18) which is a copy of the BCT DSO (0SD_O06). I've chosen this DSO because this is the BCT DSO which is used to store data from a Standard Extractor 2LIS_13_VDKON.
    Below are the screenshots of these 2 DSOs:
    I have successfully extracted the data from 2LIS_13_VDKON (includes PROD_HIER but not Customer Number) and loaded into a DSO (ZSD_D17).
    All the testing is done using only one Sales Document No (VBELN).
    First test that I tried is.. to create an Infocube and loaded data from ZCOPA_01 and ZSD_DS18 and when the LISTCUBE was run on this InfoCube, the data is coming up in two different lines which is not very meaningful. Screenshot below:
    Therefore, I have created another DSO (ZSD_DS17) to Consolidate the data from ZCOPA_01 & ZSD_DS18 establishing mappings between some of common Chars such as below:
    ZCOPA_01                    ZSD_DS18
    0REFER_DOC  <->        0BILL_NUM
    0REFER_ITM    <->        0BILL_ITEM
    0ME_ORDER    <->        0DOC_NUMBER
    0ME_ITEM        <->        0S_ORD_ITEM
    51 records are loaded from ZSD_DS18 into ZSD_DS17 and 4 records are loaded from ZCOPA_01 into ZSD_DS17 for a particular Sales Document Number.
    When I am using a Write-Optimized DSO, data is coming in just 1 line but it is showing only 4 lines which is aggregated which is as expected since W/O DSO aggregates the data. However, when I use Standard DSO, the data is again splitting up into many lines.
    Is there something that I am missing in here while designing the Data Model or does this call for some ABAP being done, if so, where or should I have to talk to the Functional Lead and then Enhance the Standard Extractor, and even if I do that, I would still have to bring in those Key Figures from ZCOPA_01 for my reporting?
    Thank you very much in advance and your help is appreciated.
    Thanks,
    Chandu

    in your (current) InfoCube setup, you could work with "constant selection" on the key figures
    for the COPA key figures, you'll need to add product hierarchy to the key figures with a selection of # and constant selection flagged
    for the SD key figures, you'll have to do the same for customer & the product hierarchy levels (instead of product hierarchy)

  • Converting modbus data from two registers into float

    I am reading modbus data from a DUT from two holding registers- 40609 and 40610. The register content I get is an array of two elements (12458, 14019). I want to convert these numbers into a floating point value. Does modbus library has a VI that does it? If not, how do you convert it?
    Thanks!
    Solved!
    Go to Solution.

    Like this
    That is join numbers and also typecast.
    Attachments:
    sample1.png ‏11 KB

  • How to retrieve different data separated by comma into one column

    Hi all,
    We have a Custom View.In that some of the customer's Bill-To address is different remaining all columns contain same data.In that case if we query with that customer_number it displays more than one row with different Bill-to addresses,it is fine.But our requirement is we need to display only one row for that customer_number and Bill-to address column shows all Bill-to addresses corresponding to that customer separated by comma.
    Could anyone give us any idea to solve this.
    Thanks in Advance,
    Dhana

    i do not a concatenated data
    i have a data in a table with columns A & B of same size
    A B
    1 2
    2
    3 1
    4 2
    5 3
    6 5
    7 1
    8 4
    9
    10 8
    if my where condition is 'where A=2'
    my output should be
    1
    2
    3
    4
    5
    6
    8
    10
    i want my query to search as loop so that it keeps on searching
    for related data as in my case it is
    2 is linked to 1
    1 is linked to 3
    3 is linked to 4
    my query should keep on seaching for linked numbers till
    it does not find any mathing linked numbers
    and the resulted output should come in one single column

  • How to merge the data from two cubes into ODS?

    Hi,
    I wan to analyze the data of both the cubes by means of merging into an ODS.
    And i want to have one of the characteristic is used as a key for the purpose which is existing in both the cubes
    Cany nay one detail me of how this can be done?
    Thanks,
    Ravi

    Hi,
    If it is very needful.
    you can create the ODS object for each infocubes and map these ODS objects to target ODS object.
    or, you can create the Export datasources from each infocube and map these to new target ODS object which is having all the char and KF of both the infocubes.
    reg.
    Vis

  • Pulling in data from two cubes in one common report in OBIEE

    Hi,
    We have a scenario wherein we are using Oracle OLAP Cubes as data source for reporting against OBIEE v10.1.3.3.2. The specific question that we have can be exemplified as below:
    The Analytic Workspace (as created using AWM) has the following seven dimensions:
    Dimension A
    Dimension B
    Dimension C
    Dimension D
    Dimension E
    Dimension F
    Dimension G
    Based on the above dimensions, we have the following cubes:
    Cube One : Dimension A, Dimension B, Dimension C, Dimension D and Dimension E
    Cube Two : Dimension D, Dimension E, Dimension F, Dimension G
    So essentially, we have two cubes in the same Analytic Workspace and they do have a few dimensions in common.
    What we now need to know is how best to include these two cubes in the same logical model in the business and presentation layers of the OBIEE repository - this needs to be done because we want to include measures from both the cubes in a common report.
    Any ideas on the implementation of this scenario are highly appreciated.
    Regards,
    Piyush

    Hello Wildmight,
    I am sorry for the duplicate updates - and I regret the inconvenience caused.
    Here is what we are trying to achieve:
    We have a Business Domain wherein two measures are of importance : M1 and M2. Also, we now know that M1 and M2 are dimensioned as below:
    M1 - Dimensions A, B, C, D , E , F, G and H
    M2 - Dimensions C, D , F and G
    Hence, we are looking at an AW with 8 dimensions and two cubes : One for M1 with 8 dimensions and the other for M2 with 4 dimensions. Also, here comes the need to have a report wherein we can see the values of M1 and M2 in the same report and then do some calculations and analysis using both the figures at the same time. What we now need to know is how best to include these two cubes (which have 4 dimensions in common) in the same logical model in the business and presentation layers of the OBIEE repository so that we can address the reporting requirement of having values of M1 and M2 in the same report.
    Any help is much appreciated.
    Best Regards,
    Piyush

Maybe you are looking for

  • Alchemy and EAX doesn't w

    Hi I'm trying to get EAX sound working in games using Vista, X-Fi Extreme Music and Creative Alchemy. I've installed alchemy and added the games in the console yet the EAX options in game are still greyed out. Any ideas? Thanks Flim

  • Pass value beetween pages in session state

    Hi, I'm getting mad to find out how on the main "sample application" can be passed value from P11_CUSTOMER_ID field to P12_CUSTOMER_NAME field using session ! Can anyone explain me ! No process are submitted on 11 pages ! Thanks, Ivan

  • Mapping Stuck Threads to Proxy Services

    Hello OSB Experts: Is there a way I can map the information of a thread dump showing stuck threads to the proxy service that those threads are executing? I am facing a situation that seems to be usual: one of several backends is performing poorly, pr

  • N80 Bluetooth connection problems

    Hi, i really am hoping someone can help i have been a big Nokia fan for a long time but have lately owned Motorola and sony ericson, but i have just bought the Nokia N80, which i have to say is the best phone i have owned yet, but i have a big proble

  • Alias could not be found error when networking with PC

    I am trying to connect to the PC's at work via the ONLY Mac on the network. When I go to the Network home in the Finder, I can see all of the PC's on the system, but everytime I try to connect to them with the correct username and password, I get thi