How to Concatenate Multiple Column Records from multiple tables

my question is
there are three tables like A,B,C
i want the data from these tables with the help of relation
select a.simno,b.item_code,c.desc
from A a,B b,C c
WHERE a.ms=b.ms and
b.item_code=c.item_code
and a.ms=c.ms
the output for this query which i am getting is
simno item_code desc
1 i1 abc
1 i2 def
1 i3 xyz
2 i4 gtr
2 i5 poi
but i want the output in this
simno details
1 abc#def#xyz
2 gtr#poi
and so on
if it dispayes the output inthis manner i can save as ".csv" file

Hi,
There are different Solutions you can achieve
Refer to Asktom : http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
SQL> create table test(simno number, itemcode varchar2(5), desc1 char(5))
Table created.
SQL> insert into test(simno,itemcode,desc1) values (1 ,'i1' ,'abc');
1 row created.
SQL> insert into test(simno,itemcode,desc1) values (1 ,'i2' ,'def') ;
1 row created.
SQL> insert into test(simno,itemcode,desc1) values (1 ,'i3' ,'xyz') ;
1 row created.
SQL> insert into test(simno,itemcode,desc1) values (2 ,'i4' ,'gtr');
1 row created.
SQL> insert into test(simno,itemcode,desc1) values (2 ,'i5' ,'poi');
1 row created.
SQL> select simno,wmsys.wm_concat(desc1) CONCAT
  2  from test
  3  group by simno;
     SIMNO
CONCAT
         1
abc  ,def  ,xyz
         2
gtr  ,poi- Pavan Kumar N

Similar Messages

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • How to delete some of records from wf_notifications table any API Name?

    Hi All,
    I want to delete some of records from wf_notifications table , can any one tell API' name and Back end delete process.
    Thanks,
    Ramu
    Edited by: Ramu on Mar 20, 2013 5:42 AM

    Hi ,
    I hv done below script, now it's working fine.
    DECLARE
    CURSOR csr_transaction_id IS
    SELECT   hat.transaction_id,
             hat.item_type,
             hat.item_key,
             ppx.employee_number,
             hat.section_display_name
      FROM   hr_api_transactions hat, per_people_x ppx
    WHERE   hat.process_name = 'HR_PERSONAL_INFO_JSP_PRC'
             AND hat.selected_person_id = ppx.person_id
             AND ppx.employee_number IN
                      ('100024773',
                       '100024820',
                       '100024859',
                       '100024879',
                       '100024902',
                       '100024937',
                       '100025137',
                       '100026470',
                       '610014755',
                       '610017039')
    order by  ppx.employee_number;
    BEGIN
      dbms_output.put_line('***Deleted all Transactions  and Notifications of below Employee Personals Tranactions ***');
       FOR my_cur_v IN csr_transaction_id
       LOOP
       /*Delete all Transaction_id's in hr_api_transactions,hr_api_transaction_steps,hr_api_transaction_values and hr_api_transaction_steps_bk tables */
        hr_transaction_swi.delete_transaction
                              p_transaction_id =>my_cur_v.transaction_id,
                              p_validate => hr_api.g_false_num
        wf_engine.abortprocess  (
                                  itemtype => my_cur_v.item_type,
                                 itemkey => my_cur_v.item_key
         /* Deleted all Notification_id's and item_key's in wf_item_activity_statuses,wf_items,wf_item_attribute_values,wf_notifications     Table */                     
         wf_purge.items (
                          itemtype => my_cur_v.item_type,
                         itemkey => my_cur_v.item_key
        dbms_output.put_line('Emp No --'||my_cur_v.employee_number||'Transaction_id :'||my_cur_v.transaction_id||'Emp Personal Info :'||my_cur_v.section_display_name||
                              'Item Type :'||my_cur_v.item_type|| 'Item Key :'||my_cur_v.item_key); 
       END LOOP;
       commit;
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line('hr_transaction_swi.delete_transaction api goest to exception block'    ||sqlcode|| '  '||sqlerrm);
    END;  
    /thanks,
    Ramu

  • How do I extract matching records from two tables?

    I'm trying to extract client records from our client database to put together a very targeted email campaign. As an example, the result I want is a list of names and email addresses of those clients who have a record in our system, have not had a visit in our clinic in the last year, and live within 200 miles of our clinic. I can capture the first two criteria in one extract, and the second in another. I can then import those as tab delimited data into Numbers. What I then need to do is create a third table that represents ONLY those records that exist in both tables.
    Can someone tell me if this is possible and if so, how to do it?
    I'd be very appreciative of any help, thank you.

    conejo61 wrote:
    I can then import those as tab delimited data into Numbers. What I then need to do is create a third table that represents ONLY those records that exist in both tables.
    You can create a column that generates a serial marker on the table from which you want to transfer the data, making all the names that also appear on the other table. Not that the formula will mark only exact matches.
    Here's a short example:
    Table 1 on the left, is one of the two tables imported from the tab delimited data files. It has other data, but only the names in column A are used to identify records appearing on both tables.
    Table 2 on the right, contains the names and other data (represented by the email addresses in column B), to be transferred to the third table.
    Column C of this table contains the formula that counts off the rows containing names appearing on both tables. The version below is in C2, and is filled down to the end of the column.
    =IF(COUNTIF(Table 1 :: $B,A2)>0,MAX($C$1:C1)+1,"")
    Note that jane Doe is not counted (or transferred) as her name is recorded differently on the two tables.
    Table 3 is the results table. It contains one formula for each column to be transferred from Table 2 to Table 3.
    A2:   =IF((ROW()-1>MAX(Table 2 :: $C)),"",LOOKUP(ROW()-1,Table 2 :: $C,Table 2 :: $A))
    B2:   =IF((ROW()-1>MAX(Table 2 :: $C)),"",LOOKUP(ROW()-1,Table 2 :: $C,Table 2 :: $B))
    Regards,
    Barry
    EDIT: I was working in Numbers '09 when developing this, and got the following warning when I saved a copy as an iWork '08 document:
    Referencing row or column ranges that include header or footer cells isn't supported. The formula references were updated to exclude header and footer cells.
    The formulas in Table 2::C2 references C1. You may have to ensure that Table 2 does not include a header row.
    B.
    EDIT2: A check on the file in Numbers '08 showed no apparent change to the formula, and editing Jane Doe's name on table 1 resulted in her name being added to Table 3.
    Message was edited by: Barry

  • How to handle the failed records from the table when using DB Adapter

    Hi,
    I am reading some records from table using DB Adapter inside my synchronous BPEL process. Say like reading 100 records from table in between after successful reading of 90 records an error occured in 91st record due some various reasons(like DB down, Connection interrupted etc.). Then how to handle this situation, whether i have to read all the records from the begining and is there any option to continue from where it stopped reading.
    Can please anybody help me out in the regard?
    Thanks in advance
    Regards,
    Aejaz

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • How to read a particular record from BRF+ table in ABAP

    hi all,
    I have a requirement where a particular record has to be read based on certain value for a set of columns from BRFplus Decision table to Delete/Update. I tried many methods of CL_FDT* but could not find any right one.
    Could anyone please help me?
    Thanks,
    Deepika

    Hi Deepika,
    There is one solution from my side.
    1. Include the Decision table in a BRF+ function.
    2. Set the input and result of the function.
    3. Call the function in the ABAP.
    4. Get the record from result.
    Please find the call function logic in ABAP as below.
    Data:
            lo_admin_data         TYPE REF TO if_fdt_admin_data,
            lo_function           TYPE REF TO if_fdt_function,
            lo_context            TYPE REF TO if_fdt_context,
            lo_result             TYPE REF TO if_fdt_result.
    cl_fdt_factory=>get_instance_generic( EXPORTING iv_id = "functon id in general tab"
                                                          IMPORTING eo_instance = lo_admin_data ).
    lo_function ?= lo_admin_data.
    *Set input parameter
    lo_context ?= lo_function->get_process_context( ).
    lo_context->set_value( iv_name = "parameter name"    ia_value ="parameter value" ).
    lo_function->process( EXPORTING io_context = lo_context
                                              IMPORTING eo_result = lo_result ).
    lo_result->get_value( IMPORTING ea_value = "Result" ).
    Best Regards
    Clark Huang

  • How can we select duplicate records from a table

    Hi
    I desire to use a query to select duplicate columns (based on all the columns of the table) ...
    I am able to write queries which include column names, but when my table contains more than 50 columns, is it advisable for me to mention all the 50 column names in the query or is there any other query by which duplicate rows can be selected without column names being mentioned ?
    Thnx in advance
    Regards

    Basic rule of relational design says that "thy table shalt have a primary key".
    Now assuming that you do not have a primary key constraint and that resulted in duplicates, you should still have a couple of columns that uniquely describes a row in that table.
    To select duplicate rows can then be done by joining rows with the primary key (same set of unique columns), where rows have different rowids (physical addresses).
    E.g.
    select
    t1.*,
    t2.*
    from table t1,
    table t2
    where t1.col1 = t2.col1
    and t1.col2 = t2.col2
    and t1.rowid < t2.rowidIf you do not have a couple of columns (primary key) that uniquely identifies a row, then you do not have duplicates in the table - as there cannot be duplicates without having a means of unique identification.

  • Concatenate a column value across multiple rows - PDW

    We are using PDW based on SQL2014. We require an efficient logic on how to concatenate a column value across multiple rows. We have the following table
    T1
    (CompanyID, StateCD)
    Having following rows:
    1              NY
    1              NJ
    1              CT
    2              MA
    2              NJ
    2              VA
    3              FL
    3              CA
    We need a code snippet which will return following result set:
    1                    
    CT,NJ,NY
    2                    
    MA,NJ,VA
    3                    
    CA,FL
    We have tried built-in function STUFF with FOR XML PATH clause and it is not supported in PDW. So, we need a fast alternative.

    Hi Try this:
    SELECT * INTO #ABC
    FROM 
    SELECT 1 AS ID,'NY' AS NAME
    UNION 
    SELECT 1 AS ID,'NJ' AS NAME
    UNION 
    SELECT 1 AS ID,'CT' AS NAME
    UNION 
    SELECT 2 AS ID,'MA' AS NAME
    UNION 
    SELECT 2 AS ID,'NJ' AS NAME
    UNION 
    SELECT 2 AS ID,'VA' AS NAME
    UNION 
    SELECT 3 AS ID,'FL' AS NAME
    UNION 
    SELECT 3 AS ID,'CA' AS NAME
    )A
    CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800)) 
    DECLARE @TMP VARCHAR(MAX), 
            @V_MIN INT,
    @V_MAX INT,
    @V_COUNT INT
    SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC 
    SET @V_COUNT=@V_MIN
    WHILE @V_COUNT<=@V_MAX
    BEGIN
    SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC 
    WHERE ID=@V_COUNT
    INSERT INTO ##CDB (ID, NAME) SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME 
    SET @V_COUNT=@V_COUNT+1
    END
    SELECT * FROM ##CDB
    OR
    SELECT * INTO #ABC
    FROM 
    SELECT 1 AS ID,'NY' AS NAME
    UNION 
    SELECT 1 AS ID,'NJ' AS NAME
    UNION 
    SELECT 1 AS ID,'CT' AS NAME
    UNION 
    SELECT 2 AS ID,'MA' AS NAME
    UNION 
    SELECT 2 AS ID,'NJ' AS NAME
    UNION 
    SELECT 2 AS ID,'VA' AS NAME
    UNION 
    SELECT 3 AS ID,'FL' AS NAME
    UNION 
    SELECT 3 AS ID,'CA' AS NAME
    UNION 
    SELECT 5 AS ID,'LG' AS NAME
    UNION 
    SELECT 5 AS ID,'AP' AS NAME
    )A
    CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800)) 
    DECLARE @TMP VARCHAR(MAX), 
            @V_MIN INT,
    @V_MAX INT,
    @V_COUNT INT
    SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC 
    SET @V_COUNT=@V_MIN
    WHILE @V_COUNT<=@V_MAX
    BEGIN
    SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC 
    WHERE ID=@V_COUNT
    SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME INTO #TEMP 
    INSERT INTO ##CDB (ID, NAME) SELECT ID, NAME FROM #TEMP WHERE NAME<>''
    DROP TABLE #TEMP
    SET @V_COUNT=@V_COUNT+1
    END
    SELECT * FROM ##CDB
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • How to get large no of records from adf table

    Hi All,
    I'm working on adf.I'm using jdeveloper 11.1.1.5 version.In my adf application i have 1000 records in my adf table.I want to get the 500 selected records from that table at a time.But im not able to get huge number of records.How can i get the records from adf table.Please give me ur valuable suggestions.
    Thanks!

    Hi.
    for large record check the oficial doc.
    http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvvo.htm#CEGDBJEJ
    PAGE_RANGING is the best option for large tables.
    and these maybe will help you
    Re: Performance scrolling large ADF tables
    Re: Expert opinion needed: Best practices to handle huge rowsets on UI

  • How To Concatenate Column Values from Multiple Rows into a Single Column?

    How do I create a SQL query that will concatenate column values from multiple rows into a single column?
    Last First Code
    Lesand Danny 1
    Lesand Danny 2
    Lesand Danny 3
    Benedi Eric 7
    Benedi Eric 14
    Result should look like:
    Last First Codes
    Lesand Danny 1,2,3
    Benedi Eric 7,14
    Thanks,
    David Johnson

    Starting with Oracle 9i
    select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
    from
    (select last, first, code, row_number() over(partition by last, first order by code) rn
    from a)
    connect by last = prior last and first = prior first and prior rn = rn -1
    start with rn = 1
    group by last, first
    LAST       FIRST      CODES                                                                                                                                                                                                  
    Lesand         Danny          1,2,3
    Benedi         Eric           7,14Regards
    Dmytro

  • Need assistance searching records from multiple tables - Please Help!

    Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience.  I need help, and I hope someone here can give me some direction.
    I am using VB 2008, and the CR that comes bundled with VS 2008 Pro.  My database is a SQL Server 2005 CE v3.5 (a *.sdf file).  I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
    My dataset consistes of two tables:
    1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information. 
    2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
    Here's what I'm trying to accomplish:  I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria.  Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column.  If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
    I don't know what I'm doing wrong, though.  I can search a dataset if I am only querying one table and pulling records from that table.  However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records. 
    If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
    Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
    Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
    Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
    I am suspicious that my problem is in the Tables(1) method.  It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work. 
    Whatever the case, I'm at the end of my rope with this one.  I'm not prone to giving up, but I'm at a dead end currently. 
    Any attempt to assist me with this will be greatly appreciated, successful or not.
    Thanks in advance!
    -Will

    No, I am connected via ADO.NET.  I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet).  So this isn't a stored procedure.
    When I examine the link, I can only choose an Inner Join or a Left Outer Join.  Right Outer and Full Outer are not available.  Could this be a problem with the dataset I'm using?
    Could you explain what you mean by display all of the records and then choose the selection criteria?

  • Sender JDBC Adapter : Fetch records from multiple tables

    Hi Friends,
    I am using sender JDBC adapter to select few records from DB2 database table.
    This scenario is working fine.
    Now my requirement is to fetch records from 3 tables. These table are independent to each other. There is no primary key or foreign key.
    Please let me know how to write the sql in sender JDBC adapter to fetch records from these 3 tables.
    Thanks,
    Sandeep Maurya

    hi sandeep...
    if the tables are completely independent and do not share any primary / foreign key relation ship...
    why dont u think towards creating a seperate interface for each of them..
    or if u still want to select from multiple table at once..the best way would be to write a stored procedure on the sender side which do all the fetching n processing and pass the final resultset to PI
    or u can think towards fetching the data from 1 table and then in UDF do lookup from other tables..which again is tricky and performace intensive

  • Query regarding the data type for fetcing records from multiple ODS tables

    hey guys;
    i have a query regarding the data type for fetcing records from multiple ODS tables.
    if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
    can any one help with some suggestion.

    Hi Mudit,
    One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
    AS is used to rename the column name when data is being selected from your DB.
    So, the query  Select ename as empname from emptable will return the data with column name as empname.
    Regards,
    Bhavesh

  • Allow multiple records from this table to be displayed in the form is greyed out.

    I'm trying to add a second table to my main data source in an InfoPath 2010 form (database template), but the option to allow multiple records from this table to be displayed in the form is greyed out and I can't select it.
    Can someone please tell me how to correct this? I'm guessing that there might have to be something change in MS SQL because on other occasions I've have not encountered this problem when adding a second table.
    Any help would be greatly appreciated.
    Thanks.

    So I've found a work around, but I still don't know why I'm having the problem in the first place.
    I've been trying to relate the two tables by using the primary key in the parent table to a view of the child table that also includes primary key in the parent, e.g. the ORDER ID in the order table relating to the ORDER ID in the view of the order detail
    table. For whatever reason whenever I did that InfoPath prohibited the data source from returning multiple order details.
    My work around is to use views of both the order table and order details table that include the customer ID and to relate the two table in InfoPath using the customer ID. Now I get a data source that allows multiple order detail records. In order to get
    just the order details that I want that relate to a particular order, I use a rule that sets the order id in both the order and order details query data sets before executing the query (as opposed to just the order data set).
    Hope that's a clear explanation.

  • HELP: Is it possible to record from multiple video streams using iMovie?

    Is it possible to record from multiple video streams using iMovie.
    I want to record a presenter on a greenscreen and also his powerpoint slides at the same time and cut from one to other.
    Can imovie record from screen and camera at same time?
    If so is there a link to somewhere explaining how to do so?
    If not, what is the most efficient way to do so, without having to learn a whole complex program?
    Please advise asap.
    Very many thanks

    Alan and Anthony,
    Thanks for the quick responses. Unfortunately, there is no backup :(.
    I will ask if they get logged into the global zone, but one thing I forgot to mention is that this zone (as are all our non-global zones and the global zone also) are configured for ldap logins.
    Assuming that they can even try to login to the global zone, can they even see the directory structure in the non-global zone (sorry, I haven't worked with Zones much thus far) from the global zone?
    Also, if they can see the non-global zones directory structure, what should they then try?
    Also, I've been searching and I've seen some suggestions of running a "pkgcheck -af" which might restore the directory permissions to what the various packages expect. Assuming that they can get to the point that they can at least log into the zone, is that something that would work?
    I'm setting up a new test Solaris box now, with a zone, to try to reproduce the problem. If I can reproduce the problem, I'll post back whether or not I see the same thing.
    In the meantime, if anyone has any suggestions, please post them.
    Thanks,
    Jim
    P.S. In case you're wondering, the box/zone that got messed up was a test/integration zone, and they were in the process of installing some software when this chmod happened.

Maybe you are looking for

  • How do I Connect Dell E2211H monitor to a PPC Mac Mini???

    How do I connect a Dell E2211H monitor to a Mac mini (PPC)

  • Multi level grouping in views

    Hi  I am using SharePoint 2013, I wanted help on how to do multi level grouping in views. The view should be like as follows: -Category1    -Level1       -Title1            data -Category2     -Level2        -Title2            data 

  • PortalRolesSearch Configuration

    We have enabled the portalRolesSearch index in our Netweaver 7.01 portal.  We make extensive use of the related links functionality in our iViews.  The problem is if you have iViews with related links to one iView (example: Dental), when searching fo

  • Variable messages

    Hello, when i modify a past order (year 2007), system shows to me a warning message: V1 017 - The purchase order date is in the past. Please check. I've been searching into notes but i don't find it. I know that variable messages could been modified

  • Customer WYSIWYG Collaborative tool for web pages in Creative Cloud?

    In Creative Cloud, is there a program/tool that will allow website customers to login and edit pre-defined sections of their website with a WYSIWYG editor?