On Denormalization. How can I make this query shorter or better? (SQL SERVER 2000)
    INSERT INTO
    denormalizedTable
    
    SELECT
    table1.userName,
    MAX(CASE WHEN table2.Type = 1 THEN table2.Question END) AS question_1,
    MAX(CASE WHEN table2.Type = 1 THEN table2.Answer END) AS answer_1,
    MAX(CASE WHEN table2.Type = 2 THEN table2.Question END) AS question_2,
    MAX(CASE WHEN table2.Type = 2 THEN table2.Answer END) AS answer_2,
    MAX(CASE WHEN table2.Type = 3 THEN table2.Question END) AS question_3,
    MAX(CASE WHEN table2.Type = 3 THEN table2.Answer END) AS answer_3,
    MAX(CASE WHEN table2.Type = 4 THEN table2.Question END) AS question_4,
    MAX(CASE WHEN table2.Type = 4 THEN table2.Answer END) AS answer_4,
    MAX(CASE WHEN table2.Type = 5 THEN table2.Question END) AS question_5,
    MAX(CASE WHEN table2.Type = 5 THEN table2.Answer END) AS answer_5,
    MAX(CASE WHEN table2.Type = 6 THEN table2.Question END) AS question_6,
    MAX(CASE WHEN table2.Type = 6 THEN table2.Answer END) AS answer_6,
    MAX(CASE WHEN table2.Type = 7 THEN table2.Question END) AS question_7,
    MAX(CASE WHEN table2.Type = 7 THEN table2.Answer END) AS answer_7,
    MAX(CASE WHEN table2.Type = 8 THEN table2.Question END) AS question_8,
    MAX(CASE WHEN table2.Type = 8 THEN table2.Answer END) AS answer_8
    
    FROM
    table1
    JOIN
    table2
    ON
    table1.userID = table2.userID 
    
    GROUP BY table1.userName
On Denormalization. How can I make this query shorter or better? (SQL SERVER 2000)
===

    INSERT INTO
    denormalizedTable
    
    SELECT
    table1.userName,
    MAX(CASE WHEN table2.Type = 1 THEN table2.Question END) AS question_1,
    MAX(CASE WHEN table2.Type = 1 THEN table2.Answer END) AS answer_1,
    MAX(CASE WHEN table2.Type = 2 THEN table2.Question END) AS question_2,
    MAX(CASE WHEN table2.Type = 2 THEN table2.Answer END) AS answer_2,
    MAX(CASE WHEN table2.Type = 3 THEN table2.Question END) AS question_3,
    MAX(CASE WHEN table2.Type = 3 THEN table2.Answer END) AS answer_3,
    MAX(CASE WHEN table2.Type = 4 THEN table2.Question END) AS question_4,
    MAX(CASE WHEN table2.Type = 4 THEN table2.Answer END) AS answer_4,
    MAX(CASE WHEN table2.Type = 5 THEN table2.Question END) AS question_5,
    MAX(CASE WHEN table2.Type = 5 THEN table2.Answer END) AS answer_5,
    MAX(CASE WHEN table2.Type = 6 THEN table2.Question END) AS question_6,
    MAX(CASE WHEN table2.Type = 6 THEN table2.Answer END) AS answer_6,
    MAX(CASE WHEN table2.Type = 7 THEN table2.Question END) AS question_7,
    MAX(CASE WHEN table2.Type = 7 THEN table2.Answer END) AS answer_7,
    MAX(CASE WHEN table2.Type = 8 THEN table2.Question END) AS question_8,
    MAX(CASE WHEN table2.Type = 8 THEN table2.Answer END) AS answer_8
    
    FROM
    table1
    JOIN
    table2
    ON
    table1.userID = table2.userID 
    
    GROUP BY table1.userName