Convert table with each field as a different record to a "normal" table
<p>I am having to deal with a table (BldDetails) with the following fields: BldgID (Integer), ResourceId (string), ResourceValue (string)</p>

<p>Each of the different attributes (ResourceID with up to 50 possible items) for a building are stored as separate records.  So if there is data for each of the attributes YearBuilt, BuildingSize, and Quality, there would be three records in the table.  If there is no information on Quality for example, there would only be two records (YearBuilt and BuildingSize).  I know this may not be normal data storage methodology but I am unable to modify the table structure.</p>

<p>What I need to do is create a SQL that will draw the BldgID, three specific ResourceId (YearBuilt, BuildingSize, and Quality), and their respective values from up to three separate records into a table that has the following fields: BldgID, YearBuilt, BuildingSize, and Quality.</p>

<p>Any thoughts?</p>