You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(SELECT*FROM`cost_code`WHERE (`cost_code`.`project_id` IS NULL)
AND ((`cost_code`.`company_id`=1) OR (`cost_code`.`company_id`=1)) LIMIT20)
UNION
(
SELECT`cost_code`.*FROM`cost_code`INNER JOIN`user_has_project`ONuser_has_project.project_id=cost_code.project_idANDuser_has_project.user_id=5WHERE`cost_code`.`company_id`=1 )
You can see LIMIT 20 is placed inside the first query. I want it outside of both query so I expect it to look like this
(SELECT*FROM`cost_code`WHERE (`cost_code`.`project_id` IS NULL)
AND ((`cost_code`.`company_id`=1) OR (`cost_code`.`company_id`=1)) )
UNION
(
SELECT`cost_code`.*FROM`cost_code`INNER JOIN`user_has_project`ONuser_has_project.project_id=cost_code.project_idANDuser_has_project.user_id=5WHERE`cost_code`.`company_id`=1 )
LIMIT20
Do I do something wrong ?
The text was updated successfully, but these errors were encountered:
I am trying to union 2 queries, but the LIMIT is inside first query, instead of at the outer most level
here is my code
In CostCodeQuery.php
In CostCodeSearch.php
In CostCodeController.php
The generated query is
You can see LIMIT 20 is placed inside the first query. I want it outside of both query so I expect it to look like this
Do I do something wrong ?
The text was updated successfully, but these errors were encountered: