select * from (
    select *,
    @group_index := CASE WHEN @prev_group = province THEN @group_index + 1 ELSE 1 END AS group_index,
    @prev_group := province
    from (
        select * from sb_node order by province,rand()
    ) AS T1
) as T2 where group_index <=[n]

参考: http://stackoverflow.com/questions/2643314/mysql-group-by-limit