<p>I can select all the distinct values in a column in the following ways:</p>

<ul>
<li><code>SELECT DISTINCT column_name FROM table_name;</code></li>
<li><code>SELECT column_name FROM table_name GROUP BY column_name;</code></li>
</ul>

<p>But how do I get the row count from that query? Is a subquery required?</p>

```
```
select Count(distinct columnName) as columnNameCount from tableName
```
```