• Change MAX(transactionid) to MAX( Value ) in your query

    The below method is another way to accomplish the same

    SELECT TT.TransactionId,

    MAX( CASE WHEN TT.name = 'CreatedBy' THEN TT.Value ELSE NULL END ) AS CreatedBy,

    MAX( CASE WHEN TT.name = 'CustomerId' THEN TT.Value ELSE NULL END ) AS CustomerId,

    MAX( CASE WHEN TT.name = 'Accno' THEN TT.Value ELSE NULL END ) AS Accno

    FROM TransactionTracking AS TT

    GROUP BY TT.TransactionId


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/