2013-10-08 3 views

답변

5
select * from (select * from your_table 
       where level = 1 order by rand() limit 4) x 
union all 
select * from (select * from your_table 
       where level = 2 order by rand() limit 4) y 
0

시도 ...

SELECT product_id, title, description FROM products WHERE active = 1 AND stock > 0 ORDER BY RAND() LIMIT 4; 
관련 문제