 <p>This should do what you want:</p> <pre><code>select si.Rollnumber, max(case when si.Property = 'Name' then si.Value end) as Name, max(case when si.Property = 'Year' then si.Value end) as Year, max(case when si.Property = 'City' then si.Value end) as City from StudentInfo si group by si.Rollnumber; </code></pre>