title: db2 sql pattern matching
body: <p>I have a table in db2 which has the following fields</p>
  
  <ul>
  <li>int xyz;</li>
  <li>string myId;</li>
  <li>string myName;</li>
  </ul>
  
  <p>Example dataset</p>
  
  <pre><code>xyz  |  myid         | myname
  --------------------------------
  1    |  ABC.123.456  | ABC
  2    |  PRQS.12.34   | PQRS
  3    |  ZZZ.3.2.2    | blah
  </code></pre>
  
  <p>I want to extract the rows where myName matches the character upto "." in the myId field. So from the above 3 rows, I want the firs 2 rows since myName is present in myId before "."</p>
  
  <p>How can I do this in the query, can I do some kind of pattern matching inside the query? </p>