select * from tb1 where id=rand() union all select * from tb1 where id=rand() ...
rucypli , 这个 id=rand() 不管用耶...
select * from (SELECT * from table1 ORDER BY RAND() LIMIT 1) a union all select * from (SELECT * from table2 ORDER BY RAND() LIMIT 1) b
类似这样会好吗 ?
select * from table1 where order by Rand()limit 1 union all select * from table2 where order by rand() limit 1 union all .....
(select * from table1 order by rand() limit 1 ) union all (select * from table2 order by rand() limit 1 ) union all (select * from table3 order by rand() limit 1 ) union all (select * from table4 order by rand() limit 1 ) union all (select * from table5 order by rand() limit 1 ) union all (select * from table6 order by rand() limit 1 ) union all (select * from table7 order by rand() limit 1 ) union all (select * from table8 order by rand() limit 1 ) union all (select * from table9 order by rand() limit 1 ) union all (select * from table10 order by rand() limit 1) union all (select * from table11 order by rand() limit 1) union all (select * from table12 order by rand() limit 1) union all (select * from table13 order by rand() limit 1) union all (select * from table14 order by rand() limit 1) union all (select * from table15 order by rand() limit 1)
union all
select * from tb1 where id=rand()
...
union all
select * from (SELECT * from table2 ORDER BY RAND() LIMIT 1) b
类似这样会好吗 ?
union all
select * from table2 where order by rand() limit 1
union all
.....
union all
(select * from table2 order by rand() limit 1 )
union all
(select * from table3 order by rand() limit 1 )
union all
(select * from table4 order by rand() limit 1 )
union all
(select * from table5 order by rand() limit 1 )
union all
(select * from table6 order by rand() limit 1 )
union all
(select * from table7 order by rand() limit 1 )
union all
(select * from table8 order by rand() limit 1 )
union all
(select * from table9 order by rand() limit 1 )
union all
(select * from table10 order by rand() limit 1)
union all
(select * from table11 order by rand() limit 1)
union all
(select * from table12 order by rand() limit 1)
union all
(select * from table13 order by rand() limit 1)
union all
(select * from table14 order by rand() limit 1)
union all
(select * from table15 order by rand() limit 1)