title: Select Grouped Column Values Where Have Same Id In SQL Server
body: <p>I have a table like this.</p>
  
  <p>TABLE-1</p>
  
  <pre><code>   id         Code
     -----------------
     1          N188
     1          N1Z2
     1          N222
     2          N189
     2          N1Z2
     2          N1Z3
     3          N188
     3          A123
     3          B321
     4          N188
     4          A333
     4          B444
  </code></pre>
  
  <p>I want to select id and code only code has <code>N188</code>.Result should like this:</p>
  
  <p>TABLE-2</p>
  
  <pre><code> id         Code
   ---------------
   1          N188
   1          N1Z2
   1          N222
   3          N188
   3          A123
   3          B321
   4          N188
   4          A333
   4          B444
  </code></pre>
  
  <p>How can I write sql for this in SQL Server?</p>
  
  <p>Thanks</p>