Home Forums SQL Server 2012 SQL 2012 - General How do I combine multiple rows into one (each column has different value) ? RE: How do I combine multiple rows into one (each column has different value) ?

  • DesNorton - Thursday, March 1, 2018 10:15 AM

    Tamrak - Thursday, March 1, 2018 10:04 AM

    I need help on getting another query to wrap the results from this query. The actual data has more columns (fields) than I have shown here. 

    How can I come up with one ticket number per row  and each column could fill the value of 'Yes' or 'N/A' in the appropriate columns?

    The end result should be one ticket # per row.

    SELECT number
      , Mandatory = MAX(Mandatory)
      , Valid = MAX(Valid)
      , ....
    FROM ...
    GROUP BY number

    Thanks for quick response.