left join with subselect – searching not working

Questionsleft join with subselect – searching not working
Dmitry Krasnikov asked 4 years ago

I have a complex query that uses subselects and joins.

The problem is that grid4php do not want to insert filtering condition in a proper location.

My syntax is:

Select ….. from …
left join (select … from where….. group by …)
left join …..
where….
group by…

The filter whold be inserted after the last where prior to “group by” but it inserted into subselect (prior to subselect’s “group by” accordingly)

Did i miss something to configure?

1 Answers
Abu Ghufran Staff answered 4 years ago

I tried the same case and it’s adding a filter on the outer query with latest version (free as well).

select orders.* from orders  LEFT JOIN (select employee_id from employees group by country) AS e ON e.employee_id = orders.employee_id
WHERE 1=1   AND ( `ship_via` LIKE ‘%2%’ ) group by ship_via  ORDER BY 1 ASC LIMIT 20 OFFSET 0

You can email me sample db and grid code for exact case.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

18 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?