I have below XML and my table name is table1
<Details >
<RelatedDetails>
<Name>name 1</Name>
<Position>User</Position>
<Relationship>User</Relationship>
<Salary>5000</Salary>
<Type>Company</Type>
</RelatedDetails>
<RelatedDetails>
<Name>name 2</Name>
<Position>User</Position>
<Relationship>Owner</Relationship>
<Salary>7000</Salary>
<Type>Company</Type>
</RelatedDetails>
<RelatedDetails>
<Name>name 3</Name>
<Position>User</Position>
<Relationship>Director</Relationship>
<Salary>2000</Salary>
<Type>Company</Type>
</RelatedDetails>
</Details>
I would like to get the value of 'name' where the Salary > 6000 in SQL Server.
Please suggest how this can be achieved?
Ideally i should get 'name 2' as output.