MySQL - SELECT COUNT(*) AND IGNORE SAME ID : <p>As per the title, I want to count rows in a table but if multiple rows got same ID, should count them as ONE ROW.</p>

<p>For example, I have a table named <code>my_table</code>.</p>

<p>And below is the data:</p>

<p><a href="https://i.stack.imgur.com/cpC3n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cpC3n.png" alt="enter image description here"></a></p>

<p>Ok, let's say if I run this query: <code>SELECT COUNT(*) AS cnt FROM my_table;</code></p>

<p>the result will be
<code>cnt = 6</code> ..</p>

<p>But I don't want that.</p>

<p>What I want to achieve is the <code>cnt</code> should be <code>4</code> because multiple rows with SAME ID should be counted as ONE..</p>

<p>p/s: Sorry for my bad english language..</p>
