union is merging results
i have a query that looks as following:
(SELECT title FROM pjeducations LIMIT 5)
UNION
(SELECT title FROM pjeducations WHERE animal != "all" L开发者_开发知识库IMIT 5)
UNION
(SELECT title FROM pjeducations ORDER BY price DESC LIMIT 5)
Some of the results in the second select are the same as in the first, same with the third select.
The problem is that the duplicate results automaticly get removed but i would like them to stay in it. Anyone know how to achieve this?
Use UNION ALL
instead.
Union All
preserved duplicate results
精彩评论