with t as (
select 1 id
union all select 2
union all select 3
union all select 4
union all select 5
union all select 6
union all select 7
union all select 8
union all select 9
union all select 10
)
select
*
,id % 2 as id2
from t
distribute by rand()
sort by rand()
LIMIT 5
-- order by rand() 随机效率较低,上述效率较高