Creating a SQL view with columns from other table records <p>I have a table with data like:</p> <pre> A1 FID A2 0 0 39 1 0 23 0 1 16 1 1 64 2 1 12 0 2 76 0 3 11 0 4 87 </pre> <p>And I want to create a view that will list this:</p> <pre> FID Col0 Col1 Col2 0 39 23 null 1 16 64 12 2 76 null null 3 11 null null 4 87 null null </pre> <p>How can this be possible in T-SQL?</p>