title: Teradata how can I use count(distinct)?
body: <p>I saw some questions similar but I still couldn't figure out.</p>
  <p>There is many columns, but to short, I want to count distinct by g1 column.
  I thought I could just use COUNT(DISTINCT)...?</p>
  <p>Please help me for this problem.</p>
  <p>Thank you so much in advance</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">G1</th>
  <th style="text-align: center;">C1</th>
  <th style="text-align: right;">expected results</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">2</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">2</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">B</td>
  <td style="text-align: right;">2</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">B</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">C</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">1</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">1</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">1</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: right;">1</td>
  </tr>
  </tbody>
  </table>
  </div>