title: Optimized SQL Query to retrieve a Particular set of records from Microsoft SQL Server DB
body: <p>I want to retrieve the set of data from a column in the table.
  My Scenario is:
  Iam having a table with name table1_data , In that table there is a Column with name "clm_Name", The data in the column is like this</p>
  
  <pre><code>a
  b
  c
  a
  b
  c
  a
  b
  a
  b
  c
  a
  a
  b
  c
  </code></pre>
  
  <p>I want to retrieve the data when a b c are in order if order changes it should not retrieve.(i.e, If we write a query on given data the output should be <strong>a b c a b c</strong> a b <strong>a b c</strong> a <strong>a b c</strong>) only the bolded letters should be shown in output.</p>