On 08/28/11 3:13 AM, pe...@vanroose.be wrote:
First remark: that's an unusual table design: I would have expected the pivoted form of Table2. Why? Well, every time a row is added to Table1 (DML), a*column* has to be added to Table2 (DDL).
indeed, that was my initial reaction, it looked like a schema designed by a spreadsheet user. It violates the tenets of relational data design.
If the table was properly structured, the required data could be queried with a single JOIN, albeit not in the exact output form shown.
-- john r pierce N 37, W 122 santa cruz ca mid-left coast