Results 1 to 2 of 2

Thread: Merging rows...

  1. #1
    Join Date
    Nov 2005
    Posts
    5

    Unanswered: Merging rows...

    Hello,
    I have a problem detailed below, that I need some help with.

    Data for Person 1 is stored in Table 1 across multiple rows like this. (All values are character datatypes).

    Person name age height
    1 John NULL NULL
    1 NULL 30 NULL
    1 NULL NULL 192


    I would like to use a SELECT statement to retrive the data on a single row.
    Person name age height
    1 John 30 192

    I am working on Sybase and can not figure this out. Any help would be much appreciated.

  2. #2
    Join Date
    Dec 2007
    Location
    Chennai,India
    Posts
    12
    Code:
    select person,max(name),max(age),max(height)
    from table
    group by person

Posting Permissions

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