MS SqlServer :
select top N *
from Table1
order by NewId()
mySql:
SELECT * FROM tableName ORDER BY rand()
SELECT
*
FROM
tableName
ORDER
BY
rand()