Weighted random SQL query

Miscellaneous Forums/General Discussion/Weighted random SQL query

Help!

Is something like this correct?
SELECT id, uri, title 
FROM `links`
WHERE active = "1" AND mainweight != 0 
ORDER BY Rand()*(1/mainweight) LIMIT 10