Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    2

    Unanswered: Combine multiple rows into single rows

    HTML Code:
    Hi,
    I have a table with the following data:
    
    TABLE -X
    
    RNO       FROM_SQN       TO_SQN               DATE
    ====================================================
    991       9                    11                    2010-01-01 
    991      11                    22                    2010-01-01 
    991      22                    33                    2010-01-01 
    992      33                    44                    2010-01-01 
    
    
    
    
    I want to see the result data as follows:
    
    RNO       FROM_SQN       TO_SQN               DATE
    =========================================================
    991       9                     44                   2010-01-01 
    
    
    
    
    
    
    Please help me how to achieve this using DB2 SQL.

  2. #2
    Join Date
    Jan 2012
    Posts
    20
    select min(rno), min(from_sqn), max(to_sqn), min(date) from table_x;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •