maybe you can help, I’m using this case query, and I’m trying to do mysql weighting with it. What’s wrong with it?
SELECT *
FROM cronjob_reloaded
WHERE site IN ('site1.com', 'site2.com')
ORDER BY (CASE site
WHEN 'site1.com' THEN 0.2
WHEN 'site2.com' THEN 0.8 ) * RAND( ) DESC
LIMIT 0 , 30
MySQL said: Documentation
1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) * RAND() DESC
LIMIT 0, 30’ at line 4
Here is the right syntax of CASE