Merging two rows based on a sequence_number

Hi all
Suppose that I have a table with the following structure:
UserID          NUMBER          PK
SequenceID     NUMBER          NOT NULL
Value1          NUMBER          NULL
Value2          VARCHAR2          NULL
Value3          DATE          NULL
And, this table, is populated as examplified below:
UserID     SequenceID     Value1     Value2     Value3
1     1          10     NULL     'TEST'     
1     2          15     NULL     01/01/2011
1     3          NULL     'TEST2'     02/01/2011
2     4          20     NULL     NULL
2     5          12     'ABC'     NULL
2     6          NULL     'AB'     NULL
What I want to do is merge these rows, "grouping" then by UserID (That is the PK), on a way that the last major sequence ID always takes precedence from the previous one... So, the query should returns something like:
UserID     SequenceID     Value1     Value2     Value3
1     3          15     'TEST2'     02/01/2011
2     6          12     'AB'     NULL
Explanations:
As you can see, for each UserID, I´d like to get a row with the last filled value for each columns...
I can´t use the MAX function because, to UserID 2, I will get unexpected values on column Value2 (I would get 'ABC' insted of 'AB') and column Value1 (I would get 20 instead of 12).
How is the best way (best performance) to archieve this?
Thanks a lot!!!

Hi,
Maybe this will help:
select userid,
       max(sequenceid) keep (dense_rank last order by sequenceid) sequenceid,
       max(value1) keep (dense_rank last order by case when value1 is not null then sequenceid end nulls first) value1,
       max(value2) keep (dense_rank last order by case when value2 is not null then sequenceid end nulls first) value2,
       max(value3) keep (dense_rank last order by case when value3 is not null then sequenceid end nulls first) value3
  from t
group by userid;Sample execution:
SQL> with t as (
  2  select 1 userid, 1 sequenceid, 10 value1, NULL value2, 'TEST' value3 from dual union all
  3  select 1, 2, 15, NULL, '01/01/2011' from dual union all
  4  select 1, 3, NULL, 'TEST2', '02/01/2011' from dual union all
  5  select 2, 4, 20, NULL, NULL from dual union all
  6  select 2, 5, 12, 'ABC', NULL from dual union all
  7  select 2, 6, NULL, 'AB', NULL from dual
  8  ) -- end of test data
  9  select userid,
10         max(sequenceid) keep (dense_rank last order by sequenceid) sequenceid,
11         max(value1) keep (dense_rank last order by case when value1 is not null then sequenceid end nulls first) value1,
12         max(value2) keep (dense_rank last order by case when value2 is not null then sequenceid end nulls first) value2,
13         max(value3) keep (dense_rank last order by case when value3 is not null then sequenceid end nulls first) value3
14    from t
15   group by userid;
    USERID SEQUENCEID     VALUE1 VALUE2 VALUE3
         1          3         15 TEST2  02/01/2011
         2          6         12 AB     You can take the result of this SQL and populate the new version of table with an Insert .. Select statement.
Edited by: fsitja on Feb 25, 2011 2:57 PM Fixed it and removed test code that went "live" by mistake

Similar Messages

  • Merging two rows in report

    Hi,
    I want to merge two rows in my reprt.For ex:
    <u>Now my report is showing in this format:</u>
    Customer Plant Value
    A             B      0
                B   12.5
    <u>I want to make it as</u>
    Customer Plant Value
         A           B   12.5
    Any suggestions. Thanks.

    You can try doing a lookup for your field A at the cube or the ODS level[in your update Rules].
    You get two different records because your Field A is # not assigned in this record. Try populating your field A doing a lookup to other related ODS or cube based on your key fields. This would get you a single record with all the fields and a single record at the report level.

  • Merge Two Rows of a table to One row but into two columns

    Hi
    I Am struck in writing a query to merge two rows into two columns of one row.
    Here is the Sample data i am working with,
    Col 1     Col 2     Col3 Col4 Col Col6
    5000     573-3000 2     0     Phone      
    5000     573-3036 1     0          Fax
    5000     893-5703 3     0     WOrk      
    3000     232-5656     1     0     Phone     
    3000     353-5656     2     0          FAx
    Here Col,Col3,Col4 form the Key.
    now wht i am trying to do is to Merge these type of rows put them into Columns P,F,W,E respectively to achive a Structure as below
    Col1      P     F     W
    5000     573-3000      573-3036      893-5703
    3000     232-5656     353-5656     
    Can you please help me how could i do this.
    I am pretty ordinary at writing SQL's.
    Thanks a Lot in Advance
    Message was edited by:
    Sreebhushan

    Search the forum for PIVOT and you'll find plenty of examples.

  • [Help] How to merge two rows in a datagrid?

    How to merge two rows of a specific column in a datagrid?
    ex.
    |_______|_____|_____|
    | merged |_____|_____|
    |_______|_____|_____|
    |_______|_____|_____|
    thx a lot~

    I need to merge column heading. Have u find any solution for
    ur problem?

  • Merging two rows into a single row

    Hi ,
    I wish to merge few columns of tow rows into a single row.
    if i use union it gives two rows as o/p.
    What is the exact sql statement for that?
    Thanks

    Hi Sridhar,
    This is my code for merging and i used union.
    Suggest me good solution.
    CREATE OR REPLACE VIEW INSPECTINT.INSPECT_LOC_TRACKING_RPT_VIEW AS
    SELECT
    VEN_COMPANY_NAME VEN_COMPANY_NAME,
    VEN_COMPANY_NAME_2 VEN_COMPANY_NAME_2,
    VEN_CONTACT_FIRST_NAME VEN_CONTACT_FIRST_NAME,
    VEN_CONTACT_MIDDLE_NAME VEN_CONTACT_MIDDLE_NAME,
    VEN_CONTACT_LAST_NAME VEN_CONTACT_LAST_NAME,
    VEN_ADDRESS_LINE_1 VEN_ADDRESS_LINE_1,
    VEN_ADDRESS_LINE_2 VEN_ADDRESS_LINE_2,
    VEN_CITY VEN_CITY,
    VEN_CNT_COUNTY_CODE VEN_CNT_COUNTY_CODE,
    VEN_STC_STATE_CODE VEN_STC_STATE_CODE,
    VEN_ZIP_CODE VEN_ZIP_CODE,
    VEN_PHONE_NO_1 VEN_PHONE_NO_1,
    VEN_PHONE_EXTN_1 VEN_PHONE_EXTN_1,
    VEN_PHONE_NO_2 VEN_PHONE_NO_2,
    VEN_PHONE_EXTN_2 VEN_PHONE_EXTN_2,
    VEN_FAX_NO_1 VEN_FAX_NO_1,
    VEN_VENDOR_NO VEN_VENDOR_NO,
    VEN_APV_AP_VENDOR_ID VEN_APV_AP_VENDOR_ID,
    VEN_EMAIL_ADDRESS VEN_EMAIL_ADDRESS,
    --all these should be null
    to_number(NULL) PHY_LCN_PARAMETER_ID,
    to_char(NULL) PHY_LCN_CURRENT_ADDRESS_IND,
    to_char(NULL) PHY_LCN_STATUS_CODE,
    to_char(NULL) PHY_LCN_LTY_LOCATION_TYPE,
    to_char(NULL) PHY_LCN_ADT_ADDRESS_TYPE,
    to_char(NULL) PHY_LCN_HOUSE_NO,
    to_char(NULL) PHY_LCN_ADDRESS_LINE_1,
    to_char(NULL) PHY_LCN_ADDRESS_LINE_2,
    to_char(NULL) PHY_LCN_CITY,
    to_char(NULL) PHY_LCN_STC_STATE_CODE,
    to_char(NULL) PHY_LCN_ZIP_CODE,
    to_char(NULL) PHY_LCN_CNT_COUNTY_CODE,
    to_date(NULL) PHY_END_DATE,
    to_number(NULL) PHY_LCN_VEN_VENDOR_ID_GTA,
    to_char(NULL) PHY_LCN_SUB_LOCATION_GTA,
    to_char(NULL) PHY_LCN_DIRECTION_GTA,
    ---all these should be null
    to_char(NULL) LOW_LCN_PARAMETER_ID,
    to_char(NULL) LOW_LCN_CURRENT_ADDRESS_IND,
    to_char(NULL) LOW_LCN_STATUS_CODE,
    to_char(NULL) LOW_LCN_LTY_LOCATION_TYPE,
    to_char(NULL) LOW_LCN_ADT_ADDRESS_TYPE,
    to_char(NULL) LOW_LCN_HOUSE_NO,
    to_char(NULL) LOW_LCN_ADDRESS_LINE_1,
    to_char(NULL) LOW_LCN_ADDRESS_LINE_2,
    to_char(NULL) LOW_LCN_CITY,
    to_char(NULL) LOW_LCN_STC_STATE_CODE,
    to_char(NULL) LOW_LCN_ZIP_CODE,
    to_char(NULL) LOW_LCN_CNT_COUNTY_CODE,
    to_char(NULL) LOW_LCN_LANDLORD,
    to_number(NULL) LOW_LCN_LANDLORD_PHONE,
    to_date(NULL) LOW_END_DATE,
    to_char(NULL) LOW_LCN_SUB_LOCATION_GTA,
    to_char(NULL) LOW_LCN_DIRECTION_GTA
    FROM LOCATIONS LOC , VENDORS VEN
    WHERE LOC.LCN_VEN_VENDOR_ID_GTA IS NOT NULL
    AND LOC.LCN_VEN_VENDOR_ID_GTA = VEN_VENDOR_ID
    AND LOC.LCN_LTY_LOCATION_TYPE ='AS'
    UNION ALL
    SELECT
    to_char(NULL) VEN_COMPANY_NAME,
    to_char(NULL) VEN_COMPANY_NAME_2,
    to_char(NULL) VEN_CONTACT_FIRST_NAME,
    to_char(NULL) VEN_CONTACT_MIDDLE_NAME,
    to_char(NULL) VEN_CONTACT_LAST_NAME,
    to_char(NULL) VEN_ADDRESS_LINE_1,
    to_char(NULL) VEN_ADDRESS_LINE_2,
    to_char(NULL) VEN_CITY,
    to_char(NULL) VEN_CNT_COUNTY_CODE,
    to_char(NULL) VEN_STC_STATE_CODE,
    to_char(NULL) VEN_ZIP_CODE,
    to_number(NULL) VEN_PHONE_NO_1,
    to_number(NULL) VEN_PHONE_EXTN_1,
    to_number(NULL) VEN_PHONE_NO_2,
    to_number(NULL) VEN_PHONE_EXTN_2,
    to_number(NULL) VEN_FAX_NO_1,
    to_char(NULL) VEN_VENDOR_NO,
    to_char(NULL) VEN_APV_AP_VENDOR_ID,
    to_char(NULL) VEN_EMAIL_ADDRESS,
    decode(lcn_adt_address_type,'P',to_number(LCN_PARAMETER_ID),to_number(NULL)) PHY_LCN_PARAMETER_ID,
    decode(lcn_adt_address_type,'P',LCN_CURRENT_ADDRESS_IND,to_char(NULL)) PHY_LCN_CURRENT_ADDRESS_IND,
    decode(lcn_adt_address_type,'P',LCN_STATUS_CODE,to_char(NULL)) PHY_LCN_STATUS_CODE,
    decode(lcn_adt_address_type,'P',LCN_STATUS_CODE,to_char(NULL)) PHY_LCN_LTY_LOCATION_TYPE,
    decode(lcn_adt_address_type,'P',LCN_ADT_ADDRESS_TYPE,to_char(NULL)) PHY_LCN_ADT_ADDRESS_TYPE,
    decode(lcn_adt_address_type,'P',LCN_HOUSE_NO,to_char(NULL)) PHY_LCN_HOUSE_NO,
    decode(lcn_adt_address_type,'P',LCN_ADDRESS_LINE_1,to_char(NULL)) PHY_LCN_ADDRESS_LINE_1,
    decode(lcn_adt_address_type,'P',LCN_ADDRESS_LINE_2,to_char(NULL)) PHY_LCN_ADDRESS_LINE_2,
    decode(lcn_adt_address_type,'P',LCN_CITY,to_char(NULL)) PHY_LCN_CITY,
    decode(lcn_adt_address_type,'P',LCN_STC_STATE_CODE,to_char(NULL)) PHY_LCN_STC_STATE_CODE,
    decode(lcn_adt_address_type,'P',LCN_ZIP_CODE,to_char(NULL)) PHY_LCN_ZIP_CODE,
    decode(lcn_adt_address_type,'P',LCN_CNT_COUNTY_CODE,to_char(NULL)) PHY_LCN_CNT_COUNTY_CODE,
    decode(lcn_adt_address_type,'P',END_DATE,to_char(NULL)) PHY_END_DATE,
    decode(lcn_adt_address_type,'P',LCN_VEN_VENDOR_ID_GTA,to_char(NULL)) PHY_LCN_VEN_VENDOR_ID_GTA,
    decode(lcn_adt_address_type,'P',LCN_SUB_LOCATION_GTA,to_char(NULL)) PHY_LCN_SUB_LOCATION_GTA,
    decode(lcn_adt_address_type,'P',LCN_DIRECTION_GTA,to_char(NULL)) PHY_LCN_DIRECTION_GTA,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_PARAMETER_ID,to_char(NULL)) LOW_LCN_PARAMETER_ID,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CURRENT_ADDRESS_IND,to_char(NULL)) LOW_LCN_CURRENT_ADDRESS_IND,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_STATUS_CODE,to_char(NULL)) LOW_LCN_STATUS_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LTY_LOCATION_TYPE,to_char(NULL)) LOW_LCN_LTY_LOCATION_TYPE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADT_ADDRESS_TYPE,to_char(NULL)) LOW_LCN_ADT_ADDRESS_TYPE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_HOUSE_NO,to_char(NULL)) LOW_LCN_HOUSE_NO,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADDRESS_LINE_1,to_char(NULL)) LOW_LCN_ADDRESS_LINE_1,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADDRESS_LINE_2,to_char(NULL)) LOW_LCN_ADDRESS_LINE_2,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CITY,to_char(NULL)) LOW_LCN_CITY,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_STC_STATE_CODE,to_char(NULL)) LOW_LCN_STC_STATE_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ZIP_CODE,to_char(NULL)) LOW_LCN_ZIP_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CNT_COUNTY_CODE,to_char(NULL)) LOW_LCN_CNT_COUNTY_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LANDLORD,to_char(NULL)) LOW_LCN_LANDLORD,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LANDLORD_PHONE,to_char(NULL)) LOW_LCN_LANDLORD_PHONE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',END_DATE,to_char(NULL)) LOW_END_DATE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_SUB_LOCATION_GTA,to_char(NULL)) LOW_LCN_SUB_LOCATION_GTA,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_DIRECTION_GTA,to_char(NULL)) LOW_LCN_DIRECTION_GTA
    FROM LOCATIONS LOC
    WHERE (LCN_LTY_LOCATION_TYPE ='AS' OR LCN_ADT_ADDRESS_TYPE='D')
    AND LCN_CURRENT_ADDRESS_IND ='Y'
    thanks

  • Merge two rows & show in a single row in table results

    Hi, I need to merge 2 rows having 3 columns in a single row in table view
    The cols are currently shown as :
    Project NO-------(Current_Month) Revenue----------(Prior_Month) Revenue
    123123 10000
    20000
    Revenue is a single column with revenue for diffreent Period.
    10000 is for May
    20000 is for April
    Project NO for both are same, just the periods are different. if I am not displaying Period i need to merge the 2 rows & show as
    Project NO-------(Current_Month) Revenue----------(Prior_Month) Revenue
    123123 10000 20000
    Please let me know how we can acheive this??
    thanx
    Pankaj

    123123 is the project number..
    the above is not getting displayed properly....as the blank spaces are removed...
    Please consider this

  • How to get two rows from this data?

    SQL Gurus,
    I need to summarize the following data into two rows (two rows based on the example data below but it can be any number of rows if there are more breaks in continuos numbers)
    DETAIL_ID     FM_SERIAL_NUMBER     TO_SERIAL_NUMBER
    63009     11     11
    63009     12     12
    63009     13     13
    63009     14     14
    63009     15     15
    63009     16     16
    63009     17     17
    63009     18     18
    63009     19     19
    63009     20     20
    63009     228     228
    I need to get two rows, one showing 11-20 (that's because there's a conituity between 11 to 20)
    and the other row showing 228 - 228.
    Any help is appreciated
    Regards,
    Srini

    the example i gave had some issues.
    Here is an updated code.
    Provided your detail_id,f_serial_no,t_serial_no are numbers.
    Thanks to the example provided by Karthick_Arp      
    link:genterating one order
    WITH t AS
      (SELECT 63009 a,
        level b    ,
        level c
         FROM dual CONNECT BY level < 10
    UNION ALL
       SELECT 63009 , 228,228 FROM dual
    UNION ALL
    SELECT 63009 , 229,229 FROM dual
    UNION ALL
       SELECT 63009 , 238,238 FROM dual
    UNION ALL
       SELECT 63009,239,239 FROM dual
    UNION ALL
       SELECT 630010,223,223 FROM dual
    UNION ALL
       SELECT 630010,224,224 FROM dual
       union all
    SELECT 63009,232,232 FROM dual
      , t1 as (
      select a, b, c, decode(b-nvl(lag(b) over (partition by a order by b),1),1,0,b) d from t)
      ,t2 as (
      select a, b, c,d
         from (select row_number() over(order by b) rno, a,b,c,d
            from t1) t
        model
        return updated rows
        dimension by (rno)
        measures (a, b, c,d)
        rules update
          d[any] = case when d[cv()] = 0 then nvl(d[cv()-1],0) else d[cv()] end
        select a,min(b),max(b) from t2
        group by a,doutput
    63009     1     9
    630010     223     224
    63009     232     232
    63009     228     229
    63009     238     239
    Alvinder
    Edited by: alvinder on Feb 20, 2009 9:28 AM

  • Need to merge the below two rows

    Hi,
    I have a sample data as shown below:
    ID     OBJID     ACT_CODE     ADDNL_INFO     ENTRY_TIME
    2523540     333003736     900     from WIP default to Queue PSD1.     1/3/2012 15:07
    2523540     333003271     100     100 from Queue PSD1 to WIP For assigment. 1/3/2012 15:43
    2523540     333003744     900     900 from WIP default to Queue PSD1.     1/3/2012 15:49
    2523540     333004966     100     100 from Queue PSD1 to WIP For assigment.     1/3/2012 16:04
    I need to merge the first two rows and get a single record for each "from" and "to" as shown below (desired output)
    ID_NUMBER     ADDNL_INFO     ENTRY_TIME     EXIT_TIME     TOTAL TIME
    2523540     PSD1     1/3/2012 15:07     1/3/2012 15:43     0.025069444
    2523540     PSD1     1/3/2012 15:49     1/3/2012 16:04     0.010231481
    I have used function on the addnl_info column to display only the name of the queue "PSD1"
    (SUBSTR(ADDNL_INFO, INSTR(ADDNL_INFO, 'PSD1'), LENGTH('PSD1'))) QUEUE_NAME
    Can any one help me out in getting the desired output.

    Below is a solution to your query:
    drop table test_Table;
    create table test_Table
      ID          number,
      objid       number,
      act_code    number,
      addl_info   varchar2(500),
      entry_time  timestamp
    insert into test_Table values (2523540, 333003736, 900, 'from WIP default to Queue PSD1.', to_timestamp('1/3/2012 15:07', 'DD/MM/YYYY HH24:MI'));
    insert into test_Table values (2523540, 333003271, 100, 'from Queue PSD1 to WIP For assigment.', to_timestamp('1/3/2012 15:43', 'DD/MM/YYYY HH24:MI'));
    insert into test_Table values (2523540, 333003744, 900, 'from WIP default to Queue PSD1.', to_timestamp('1/3/2012 15:49', 'DD/MM/YYYY HH24:MI'));
    insert into test_Table values (2523540, 333004966, 100, 'from Queue PSD1 to WIP For assigment.', to_timestamp('1/3/2012 16:04', 'DD/MM/YYYY HH24:MI'));
    select * from test_table;
    select id, addl_info, entry_time, exit_time, total_time
    from
    select a.id, a.objid, 'PSD1' addl_info, a.entry_time, lead(a.entry_time, 1, null) over (order by a.entry_time) exit_time,
           lead(a.entry_time, 1, null) over (order by a.entry_time) - a.entry_time total_time, DECODE(a.act_code, 900, 'D', 'ND') disp
      from test_Table a
    where a.id = 2523540
    where disp = 'D';
    ID             ADDL_INFO            ENTRY_TIME          EXIT_TIME                     TOTAL_TIME
    2523540     PSD1     01-MAR-12 03.07.00.000000000 PM     01-MAR-12 03.43.00.000000000 PM     0 0:36:0.0
    2523540     PSD1     01-MAR-12 03.49.00.000000000 PM     01-MAR-12 04.04.00.000000000 PM     0 0:15:0.0I see a shortcoming in the design:
    1. For "WIP default to Queue PSD1" there are two records, both containing different OBJID but same ID, which in ideal case should not happen. You MUST have a COMPOSITE key on ID and OBJID; This shall help you to identify the distinct records.
    My solution is not perfect as it is based on the ENTRY TIME. The reason being SIMPLE Ordering by the OBJID would not lead to a correct difference in the Transaction Time (referred by you as TOTAL_TIME.); Hence, for this reason I had to use ENTRY_TIME to correctly get the total_time.
    If you wish you may follow the solution else I shall always recommend to change the Table Design and follow the correct approach.
    If you are changing the Table design then following shall be a solution:
    select id, addl_info, entry_time, exit_time, total_time
    from
    select a.id, a.objid, 'PSD1' addl_info, a.entry_time, lead(a.entry_time, 1, null) over (order by a.id, a.objid) exit_time,
           lead(a.entry_time, 1, null) over (order by a.entry_time) - a.entry_time total_time, DECODE(a.act_code, 900, 'D', 'ND') disp
      from test_Table a
    where disp = 'D';Regards,
    P.

  • In Web Dynpro ABAP, Can we merge two cells of a row in a table ?

    In Web Dynpro ABAP, Can we merge two cells of a row in a table ?

    Hallo Jagannatha,
    the new table feature is available in SAP NetWeaver 7.0 EhP2 (SAP ERP 6.0 EhP5, SAP Business Suite 7i2010) named 'TableMultiEditorCell'. See [SAP Online Help|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9b/46bb0d339b42cc8d30636ca0c9f5b6/frameset.htm] for more details ...
    "This UI element is a table cell variant that enables several UI elements to be placed in one table cell. This type of cell can be used for "one click actions". ...
    Regards, Bertram

  • Merging two columns with muliple rows in Numbers '09

    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon

    sanpanza wrote:
    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon
    Hi Ed,
    Use the CONCATENATE() function.
    Street address in column D, Office number in Column E
    100 Smith ST            212
    Formula: =CONCATENATE(E," ",D)
    Result:
    212 100 Smith ST
    Note the formula has three arguments, the reference to column E, a text literal (" ") containing a single space, and a reference to column D.
    Regards,
    Barry

  • How to merge two nearly identical rows without duplicating?

    In numbers, how would I merge the two rows below into one row without having duplicate data.  I just want one row with three columns that reads:
    Steve | 12345 | open
    Name
    ID #
    Status
    Steve
    12345
    Steve
    12345
    open
    I'm very new to Numbers and spreadsheet software in general. 
    Thanks!
    Steve

    Hi s,
    What data would be in the third column of the 'merged' row? How will Numbers know which to choose? Assuming that you've presented a simplified example of what the actual data will look like, what other possibilities exist besides a row 'missing' data in one or more columns? How are these possibilities to be handled?
    Rather than having us play 'dentist on a chicken farm,' it would be more productive to start with a (more complete statement of the problem. What are the details?
    Regards,
    Barry

  • How to merge two cells in a row

    hi freinds,
    how to merge two cells in alv grid using oops.
    for eg ,in the first row there is text premraj
             n in the second row there is cheguri
              my requriment is two merge the two cells ie to remove the horizontal line between them
    thanks & regards,
    premraj

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • Merging two results into a single row

    Hi, Everyone... I think this is a weighted question and I feel like it's a bit difficult to phrase, so if it doesn't make sense - let me know and I'll try to clarify or provide some more concrete examples (if I can) :)
    I have a few tables inner joined in my sql query - I'd post the entire query here but it's lengthy and will probably add a bit more confusion so let's start with theorizing - where the results sometimes generate more than one row. If more than one row exists, I'd like to take the lowest number in one field and the highest number in another field, and display them on a single row.
    For instance, when I join the PERIOD and SCHEDULE tables, the PERIOD table might provide two rows like the following:
    SCHEDULE_ID      PERIOD_ID      START_TIME    END_TIME
    123               100           32820          35640
    123               101           35940          38760My final result should take the lowest START_TIME and the highest END_TIME, even if they exist is separate rows.
    START_TIME     END_TIME
    32820           38760It doesn't seem easy to me so if someone can make sense of this - you deserve an award. :) If I can provide some more clarification, please let me know. Thanks for any help. Oracle 11g
    Edited by: nage62587 on Sep 27, 2012 11:32 AM

    nage62587 wrote:
    Thanks! I'll try that... I have more than these columns in the result and I'm thinking a Group By likely wouldn't work - I will try but in the event it doesn't, does anyone else have any other suggestions?Group by is the correct way to do this. You group several rows of output into one row. Then you decide which values from inside that group you want to see. This is certainly possible. There are more aggregation functions available than you might think, not only min/max, also min/max + KEEP, count(case expression) and so on.

  • How to merge the contents of two rows in ALV for particular column data

    Hi Experts,
    I have a requirement to merge various rows in a ALV Grid with same data for particular columns.
    Kindly Suggest,
    Thanks and Best Regards,
    Sahil

    Hi,
    Just fill the and pass the SORT table for what ever fields you want this functionality.
      DATA: lwa_sort  TYPE lvc_s_sort.
      CLEAR lwa_sort.
      MOVE: 'VBELN' TO lwa_sort-fieldname,
                   'X' TO lwa_sort-up,
    APPEND lwa_sort TO i_sort.
    Now pass this SORT table to ALV FM.
    Thanks,
    Vinod.

  • Merging of  two rows into one

    HI,
    Would you help me to write aquery such that merges two data into one,
    for example,
    Take a table Student
    Its content are
    Roll no Name
    1 Rahul
    2 Shyam
    We reqiure a query such that we get out put as
    Rahul;Shyam

    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

Maybe you are looking for

  • Album art tagging vs linking?

    Hello helpful people I am trying to find out if there is a way to determine which of my tracks have the album art linked to the file, as is the case for music bought directly from the Apple Store and where iTunes' "Get album artwork" functionality is

  • Problem with printing to a Bluetooth printer from T60p

    Hello, I have a Thinkpad T60p ( 2007-93G) and up to now I had no problem with using my HP Deskjet 460 MobilePrinter via Bluetooth. However, a few days ago I updated my "Thinkpad Bluetooth with Enhanced Data Rate Software" to v. 5.5.0.6400, and since

  • Advanced Pricing

    In advanced pricing line modifier details, we have repeating grouping no's with different qualifier context, qualifier attribute, value from, value to and so on. We want to write a query showing these repeating grouping no's as a single line or recor

  • Displaying icon in tow in table control

    Hi experts, I need help on how to display icons in every row in my table control which will be displayed via SAP GUI not Web. Did anyone have successfully done this? Thank you in advance guys..

  • [SOLVED] zenity 3.8 broke my scripts

    After updating from zenity 3.6 to 3.8, most of my scripts dont work. A little example: #!/bin/bash title="Server Options" prompt="Pick an option:" options=("option 1" "option 2" "option 3") while opt=$(zenity --width 500 --height 300 --title="$title"