I have two tables for the library schema
Table Book(BookID(Primary Key & Identity), Name, Author, Available)
Table BookDetails(BookDetailsID(Primary key & Identity), BookID(Foreign key for BookID),AttributeID(Foreign Key for Attribute),AttributeValue)
Table BookAttributes(AttributeID,Name)
So, the Book table just contains basic details and BookDetails table contains more finer details like ISBN, Publication, Pages etc..
I want a report of all the books with their attributes, I am able to get the Attributedetails of the book but not sure how to project them as columns in my result set. i am looking for something like following
BookID BookName ISBN Publication .....
-----------------------------------------------------
10 HarryPotter1 xxxx xxxxxx
20 HarryPotter2 xxxx xxxxxx
30 HarryPotter3 xxxx xxxxxx
40 HarryPotter4 xxxx xxxxxx
where ISBN and Publication etc are coming from BookDetails table where they are stored as separate rows for wach ISBN and Publication attributes keyed by Book ID. How do I project the Attribute values which are rows in BookDetails table into columns in my result set.