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

oschina-过年动弹抽奖sql

WBOY
Release: 2016-06-07 14:57:02
Original
1134 people have browsed it

老大的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
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template