select * from table order by rand() limit 1000;