title: Json list comparison - SQL Server 2016
body: <p>I'm using SQL Server 2016, and currently involved in storing, retrieving and parsing JSON data. My question is on list comparison.</p>
  
  <p><strong>Sample Data :</strong> Table has 2 columns   </p>
  
  <pre><code>Column1 - Data = 'Microsoft'  
  Column2 - Data = '{"info":{"type":1,"address":   {"town":"Bristol","county":"Avon","country":"England"},"tags":["Sport", "Water polo"]},"type":"Basic"}'
  </code></pre>
  
  <p><strong>Query :</strong>   </p>
  
  <pre><code>SELECT JSON_QUERY(Column2, '$.info.tags') from dbo.sample_table;
  </code></pre>
  
  <p><strong>Output :</strong>  </p>
  
  <pre><code>["Sport", "Water polo"]
  </code></pre>
  
  <p>How do I match if I need to check for <strong>["Water polo","Sport"]</strong> ? Does JSON library in SQL Server 2016 allow checking array content irrespective of order of data ?</p>
  
  <p>TIA</p>