title: Query for Finding Hyphen in Sql Server
body: <p>I have the records in the database like this which are as follows. I want to search in the Account Column which is my last column in my AccountDetails Table. I want to searching based on conditions like</p>
  
  <p>1- want to findt hose records which contain a hyphen after 1st number (which can be anything)<br>
  12- want to find those records which contain a hyphen after 2nd number (which can be anything)<br>
  123-want to find those records which contain a hyphen after 3rd number (which can be anything)  </p>
  
  <p><strong>AccountDetail Table</strong></p>
  
  <pre><code>230263  jba 100-1807
  230263  jba 100-1808
  230263  jba 100-1809
  235572  jba 99-1818
  235572  jba 99-1819
  235572  jba 99-1820
  235572  jba 9-1818
  235572  jba 9-1819
  235572  jba 9-1820
  </code></pre>
  
  <p>I have done like this </p>
  
  <pre><code>Select * From WF_Account Where CompanyId = 'jba' and Account Like '%-%'
  </code></pre>