1. MySQL의 경우: order by rand()를 사용한다.
[예제] select * from table order by rand() limit 0, 5
(5개만 랜덤으로 가져온다.)2.. MS-SQL의 경우: order by newid()를 사용한다.
[예제] select top 5 * from table order by newid()
(5개만 랜덤으로 가져온다.)