title: Pivot table data in tabular format, first column should be column name and rest should be value
body: <p>I just want to compare products that's why I need to show products with there attributes in column format. The First column will show attributes and rest of column shows attributes value for each column.</p>
  
  <p>Simple select statement is as follows </p>
  
  <pre><code>SELECT  product_Id,product_Name,product_Price ,product_Description,product_weight  
  from tblProduct
  WHERE  product_Id in (1139,1140,1144)
  </code></pre>
  
  <p>Now I want to show my output in following way </p>
  
  <p><img src="https://i.stack.imgur.com/WdW8Z.png" alt="enter image description here"></p>
  
  <p>I know that I need to use pivot to get that desired output. and i have tried in following way </p>
  
  <pre><code>SELECT MAX(ISNULL([1139],'')),MAX(ISNULL([1140],'')),MAX(ISNULL([1144],'')) 
  FROM
  (
    SELECT product_Id,product_Name,product_Price,product_Description,product_weight 
    FROM tblProduct where product_Id in (1139,1140,1144)
  )s 
  PIVOT
  (
    MAX(product_Name)
    FOR product_Id in ([1139],[1140],[1144])
  ) AS PVT
  </code></pre>
  
  <p>but this only done for a single column but i needed for all attributes.</p>