I have the following XML in my SQL table:
<SiteSurveyData>
<SurveyQuestionAnswers>
<QuestionGUID>61</QuestionGUID>
<Answer>XXXXXXX</Answer>
</SurveyQuestionAnswers>
<SurveyQuestionAnswers>
<QuestionGUID>62</QuestionGUID>
<Answer>XXX</Answer>
</SurveyQuestionAnswers>
<SurveyQuestionAnswers>
<QuestionGUID>64</QuestionGUID>
<Answer>Both</Answer>
</SurveyQuestionAnswers>
<SurveyQuestionAnswers>
<QuestionGUID>63</QuestionGUID>
<Answer>aal5snap</Answer>
</SurveyQuestionAnswers>
<SurveyQuestionAnswers>
<QuestionGUID>81</QuestionGUID>
<Answer>00</Answer>
</SurveyQuestionAnswers>
What I'm trying to query is that I want the value in /Answer where the /QuestionGUID = 61 and 62.
I tried using this:
value('(/SiteSurveyData/SurveyQuestionAnswers/QuestionGUID)[1]'
But it just return the first QuestionGUID.
How do i write the query so that it returns the answer for QuestionGUID 61 and 62?
Or what I just want to get the /Answer for QuestionGuid = 61.
It's not always the first element, is it possible to write the query so that it will return the value for QuestionGuid=61?