0
I have the following 3 tables: Clients, Requests, Requests:
Customers:
Solicitations:
requeca_description
The request table links to the client table(cliente_id = id[client table]) and linked to the requested table])
I need to return a client who has made more than one request!
For example I need all clients who have consulted and examined together. How do I mount a query in this scenario for this?
I want the opposite, I want "ALL" people who participated in more than one request. then the filter has to be for more than one request, for example I want every customer who participated in the request with id 1,2,3(the 3 together).
– Gustavo Alexandre
I made a modification, it would be that?
– Rodrigo Zem
I saw it, it wouldn’t be.. Because it has a customer filter.. the only filter would be in the request_description... I just want the filter on it the customer is what I want it to return. For example I want all customers who participated in the request 1,2,3,4 ... ai the sql returns me a list of clients
– Gustavo Alexandre
what fields you want to return? sol set.id id_request, sd.Description, cli.id
– Rodrigo Zem
may be just the client.name, the modification will not work pq o in works as several OR and I want the opposite.. I want it to be mandatory that the customer has attended 2 or more requests to appear... It had to be several "AND" that works. But I’ve tried so many ways.
– Gustavo Alexandre
I used group_concat, which will bring all requests from each client with the condition of having 2 or more requests
– Rodrigo Zem
Almost that, I just need to be requests that choose instead of being >=2 as I do?
– Gustavo Alexandre
as I don’t have the bank here, it gets more complicated to test rs. but see if the change would be that?
– Rodrigo Zem
But then I come back to the problem of having to be mandatory the requests to appear would have as we talk?
– Gustavo Alexandre
is pq Voce put in the above comment that needed only requests that you choose instead of >=2
– Rodrigo Zem
Then the client one, participates in the request_description(3,8,13) the 3 joints want to put a filter like this, All customers who participated in the 3,8,13 requests together.
– Gustavo Alexandre