title: Convert a row data to columns in SQL Server
body: <p>I have a scenario in which I have three columns with multiple rows, I need to select them in single row.
  Below I am attaching temporary table scenario.</p>
  
  <pre><code>CREATE TABLE #Temp
  (
    PersonID INT ,
    PhoneType VARCHAR(20) ,
    PhoneNumber VARCHAR(20)
  )
  
  INSERT  INTO #Temp
      ( PersonID ,
        PhoneType ,
        PhoneNumber 
      )
      SELECT  1212 ,
              'Business' ,
              '123456789'
      UNION ALL
      SELECT  1212 ,
              'Cell' ,
              '741852963'
      UNION ALL
      SELECT  1212 ,
              'Other' ,
              '987654321'
      UNION ALL
      SELECT  1212 ,
              'Home' ,
              '951357852'
  
  SELECT  *
  FROM    #Temp
  
  DROP TABLE #Temp
  </code></pre>
  
  <p>I need to Display,</p>
  
  <pre><code>PersonID|Business|123456789|Cell|741852963|Other|987654321|Home|951357852
  </code></pre>
  
  <p>Can anybody help?</p>
  
  <p>I have to combine this result with another Select Query,How may I do?</p>