Database Inner join For fetching Records I have two table in database. Basically these tables contains the question like subjective/objective. I want to fetch the data from these tables

table_1 :-                                           
question_id        question_value  question-type                
1                     test1          1
2                     test2          1
3                     test3          2

Table_2 :-
answer_auto_id   question_id  answer_value
1                   1             ans_sub  
2                   2             ans_sub
3                   3             ans_obj_1   
4                   3             ans_obj_2
5                   3             ans_obj_3
6                   3             ans_obj_4


result table

question_id     ans1_obj     ans2_obj    ans3_obj     ans4_obj  answer_subj
 1                NULL        NULL         NULL        NULL      ans_sub
 2                NULL        NULL         NULL        NULL      ans_sub
 3              ans_obj_1   ans_obj_2    ans_obj_3    ans_obj_4  NULL
This code will work in tsql- it doesn't even actually require a join between the tables:

    SELECT question_id, 
       MAX(ans_obj_1) AS ans1_obj, 
       MAX(ans_obj_2) AS ans2_obj, 
       MAX(ans_obj_3) AS ans3_obj, 
       MAX(ans_obj_4) AS ans4_obj, 
       MAX(ans_sub) AS answer_subj 
FROM table_2
PIVOT
(MAX(answer_value)
 FOR answer_value IN ([ans_obj_1], [ans_obj_2], [ans_obj_3], [ans_obj_4], [ans_sub])
 ) A
 GROUP BY question_id