1

Possible Duplicate:
MySQL select 10 random rows from 600K rows fast
Selecting random rows with MySQL

MY Database has 4 Coloums NAME ID Email sex with 500k rows.

select * from table where sex='m';

I want to get 50 random rows where sex='M'; Which is the fastest method

Community
  • 1
  • 1
Yahoo
  • 4,093
  • 17
  • 59
  • 85

1 Answers1

0
select * from table where sex='m'
ORDER BY RAND()
LIMIT 50
Oyeme
  • 11,088
  • 4
  • 42
  • 65