oschina-过年动弹抽奖sql

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

SELECT DISTINCT(u.id) FROM osc_opt_logs l, osc_users u 
WHERE l.user=u.id AND l.obj_type=100 AND u.role < 100 
AND DATE(l.create_time) = '2013-2-xx' 
ORDER BY RAND() 
LIMIT 2