This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Kudret, I haven't used MSSQL, but there are two approaches I can think of. You'll need to check whether they are supported.
1) If the database supports random number generation, do an "order by" on that function and then use ROWNUM to return the first 20 rows. 2) Generate 20 random #s in Java between 1 and 600. Then add a clause to the WHERE to only return ROWNUMs matching those.