title: how to take rows after a certain criteria SQL
body: <p>I am using Teradata SQL and have the following data:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>MonthID</th>
  <th>Acc</th>
  <th>Complaint</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>202202</td>
  <td>5</td>
  <td>1</td>
  </tr>
  <tr>
  <td>1</td>
  <td>202203</td>
  <td>4</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1</td>
  <td>202204</td>
  <td>3</td>
  <td>0</td>
  </tr>
  <tr>
  <td>2</td>
  <td>202202</td>
  <td>2</td>
  <td>0</td>
  </tr>
  <tr>
  <td>2</td>
  <td>202203</td>
  <td>3</td>
  <td>1</td>
  </tr>
  <tr>
  <td>2</td>
  <td>202204</td>
  <td>2</td>
  <td>3</td>
  </tr>
  <tr>
  <td>3</td>
  <td>202202</td>
  <td>1</td>
  <td>0</td>
  </tr>
  <tr>
  <td>3</td>
  <td>202203</td>
  <td>2</td>
  <td>0</td>
  </tr>
  <tr>
  <td>3</td>
  <td>202204</td>
  <td>3</td>
  <td>0</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to retrieve all the rows after per ID ever since when Complaint is &gt; 0 ordered by ID, MonthID.</p>
  <p>Expected Output:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>MonthID</th>
  <th>Acc</th>
  <th>Complaint</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>202202</td>
  <td>5</td>
  <td>1</td>
  </tr>
  <tr>
  <td>1</td>
  <td>202203</td>
  <td>4</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1</td>
  <td>202204</td>
  <td>3</td>
  <td>0</td>
  </tr>
  <tr>
  <td>2</td>
  <td>202203</td>
  <td>3</td>
  <td>1</td>
  </tr>
  <tr>
  <td>2</td>
  <td>202204</td>
  <td>2</td>
  <td>3</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Can someone please help?</p>
  <p>Thanks!</p>
  <p>Last attempt code:</p>
  <pre><code>select a.*, 
  row_number() over (partition by ID order by Complaint, MonthID) 
  from table a
  </code></pre>