Getting min from GROUP BY clause
<p>I have the following table <code>course</code></p>

<pre><code>course(idcourse, title, description, price, date, instructor)
</code></pre>

<p>And I want to get the instructor with less courses. So far I can get each instructor with the number of courses he teaches</p>

<pre><code>SELECT instructor, count(*)
FROM courses
GROUP BY instructor;
</code></pre>

<p>The result of this query in my example is this one:</p>

<pre><code>INSTRUCTOR COUNT(*)
1          5
2          2
7          5
</code></pre>

<p>Now I need to get the instructor with less courses. Which is this particular case is <code>2</code>.</p>

<p>I have tried using <code>HAVING count(*) = min(*)</code> but it gives a syntax error.</p>

<p>How should I get the min? Should I try a different approach?</p>