union-with-autofilter-problem

Questionsunion-with-autofilter-problem
Sergio asked 3 years ago

Query Union only looks in the first table of the union, but does not filter, but puts it in the first positions my code: https://github.com/keneve/keneve/blob/main/gestion_cobros some idea?

1 Answers
Abu Ghufran Staff answered 3 years ago

Hello,

To work correctly, you need to make current union query as subquery of one select query. e.g.

SELECT * FROM (
    SELECT * FROM clients WHERE gender = 'male' 
    UNION ALL 
    SELECT * FROM clients WHERE gender = 'female'
) as temp

This will apply the filter and sorting parameters to the outer most query and will give desired result.

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

19 + 3 =

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?