请教分组显示
数据表格式如下: 
 --------------------- 
 id    name    sortid 
 1    aaaaaaa    1 
 2    bbbbbbb    1 
 3    ccccccc    2 
 4    ddddddd    2 
 5    eeeeeee    3 
 ----------------------------- 
 想输入下面结果 
 --------------------- 
 id    name    sortid 
 1    aaaaaaa    1 
 3    ccccccc    2 
 5    eeeeeee    3 
 ----------------------------- 
 就是按sortid分组。然后将每组的第一项显示出来。   
 谢谢!!   
------解决方案--------------------id    name    sortid 
 1    aaaaaaa    1 
 2    bbbbbbb    1 
 3    ccccccc    2 
 4    ddddddd    2 
 5    eeeeeee    3 
 ----------------------------- 
 想输入下面结果 
 --------------------- 
 id    name    sortid 
 1    aaaaaaa    1 
 3    ccccccc    2 
 5    eeeeeee    3 
 ----------------------------- 
 select * from tab where id in(select min(id) from tab group by name)