Home >Database >Mysql Tutorial >oschina-过年动弹抽奖sql

oschina-过年动弹抽奖sql

WBOY
WBOYOriginal
2016-06-07 14:57:021128browse

老大的sql很精练。 无 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

老大的sql很精练。
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
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn