Select global min() in a new column for all rows
<p>I have a table db_race</p>

<pre><code>--------------------------
| Name    | Time | Map   |
--------------------------
| Max     | 240  | test1 |
| Alvin   | 600  | test2 |
| Amanda  | 234  | test1 |
| Angela  | 50   | test1 |
| Angela  | 2000 | test1 |
--------------------------
</code></pre>

<p>I now want to select some rows ordered by best Time on a map like the following</p>

<pre><code>SELECT Name, min(Time) AS Time 
FROM db_race 
WHERE Map='test1' 
GROUP BY Name 
ORDER BY Time ASC
</code></pre>

<p>That works perfectly fine, but I want to have the best time of all records added to another column looking like the following. (will later work with that but thats not a part of the question)</p>

<pre><code>----------------------------
| Name    | Time | TopTime |
----------------------------
| Angela  | 50   | 50      |
| Amanda  | 234  | 50      |
| Max     | 240  | 50      |
----------------------------
</code></pre>

<p>So far I tried the following but it only shows the best time, I want it for the whole selected table</p>

<pre><code>SELECT *, min(Time) AS TopTime 
FROM (SELECT Name, min(Time) AS Time 
      FROM db_race 
      WHERE Map='test1' 
      GROUP BY Name 
      ORDER BY Time ASC) a
</code></pre>

<p>I want to make sure I dont need to find the TopTime by using a subquery. The actual query will be very long and my goal is to not have it executed twice.</p>