Home Forums SQL Server 2005 T-SQL (SS2K5) how to get data from a table all in one result row RE: how to get data from a table all in one result row

  • You can use cross tabs to accomplish this. To read more about this technique, read the following article.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    SELECT ID,

    MAX( CASE WHEN Name = 'Description' THEN Type) AS Description,

    MAX( CASE WHEN Name = 'technique ' THEN Type) AS Technique

    FROM MyTable

    GROUP BY ID

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2