title: Partitioning using multiple fields and getting the same group number per partitioned group
body: <p>I have a data set that looks like below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>CarType</th>
  <th>Date</th>
  <th>Car</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Honda</td>
  <td>5/28/2022</td>
  <td>car1</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>5/28/2022</td>
  <td>car1</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>8/11/2022</td>
  <td>car2</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>8/11/2022</td>
  <td>car2</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>5/28/2022</td>
  <td>car1</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>5/28/2022</td>
  <td>car1</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>8/11/2022</td>
  <td>car2</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>8/11/2022</td>
  <td>car2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to using row_number(), rank() function create an additional column 'Expected' that looks like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>CarType</th>
  <th>Date</th>
  <th>Car</th>
  <th>Expected</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Honda</td>
  <td>5/28/2022</td>
  <td>car1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>5/28/2022</td>
  <td>car1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>8/11/2022</td>
  <td>car2</td>
  <td>2</td>
  </tr>
  <tr>
  <td>Honda</td>
  <td>8/11/2022</td>
  <td>car2</td>
  <td>2</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>5/28/2022</td>
  <td>car1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>5/28/2022</td>
  <td>car1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>8/11/2022</td>
  <td>car2</td>
  <td>2</td>
  </tr>
  <tr>
  <td>BMW</td>
  <td>8/11/2022</td>
  <td>car2</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I tried a query below. But does not seem to give me the right results</p>
  <p><code>select CarType, Date, Car,</code>
  <code>ROW_NUMBER() OVER (PARTITION BY CarType, Car ORDER BY Date ASC) AS RW from table</code></p>