Answer the question
In order to leave comments, you need to log in
How in ZF2 how to use LIMIT after a combined UNION query?
Let's consider everything in order:
There are two queries of the type
$select1; //Zend\Db\Sql\Select
$select2; //Zend\Db\Sql\Select
Using query aggregation, $select->combine($select2);
we get the following query: Next, if we use the limit method, we get the following query: Here is the question. How to make the output get a request:
The solution I found:(SELECT ...) UNION (SELECT ...)
$select->limit(69)
(SELECT ... LIMIT 0,69) UNION (SELECT ...)
(SELECT ...) UNION (SELECT ...) LIMIT 0,69
$adapter->query($sql->getSqlStringForSqlObject($select) . ' LIMIT 0,69');
is not true, because you need to use a paginator that will substitute limit itself .
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question