如何根据mysql中的其他列过滤重复值

My table is something like as given below and i want to filter the duplicate com_id values depending on the other column values (temp_id and colors).

temp_id| com_id |colors                      
  1      1       Black
  2      1       Brown
  3      1       green
  4      2       red
  5      2       yellow
  6      2       white
  7      3       blue
  8      3       grey
  9      3       orange

And i want my result table should be something like given below:

temp_id com_id  colors
   1    1   Black 
   4    2   red
   7    3   blue
   2    1   Brown
   5    2   yellow
   8    3   grey
   3    1   green
   6    2   white
   9    3   orange