In MySql, you will probably need to do something like this:
<pre>alter table yourTable add colX char;
update yourTable t
set colX = (select min from (select col2,min(col1) min
group by col2) temp1
where col2 = t.col2);</pre>
Note that this may work, but it won’t be efficient.
The inner subquery is needed because MySql raises an error if you try to update a table and read from it directly in the same update command.