0
Good afternoon Galera!
Next, below is a query where it was to bring all the calls that has the description ''Block Client - Delinquent' and with id = 572 (blocked clients), however, this query has some customers with already been unlocked, IE, already have a call with another description. I wanted to know how to bring only the records with locked clients without any calling with unlocking. Below is the query I tried.
SELECT DISTINCT
*
FROM Tarefa T
WHERE
T.TarID in(select TarID from Tarefa where T.TarTitulo = 'Bloquear Cliente - Inadimplente' AND T.TarTipID = 572
and T.TarID not in (select TarID from Tarefa where TarTipID = 574 and TarTitulo = 'Desbloqueio Cliente'))
What is the customer table/field?
– Sorack
The Table is Task only and the client field is client
– Renan Bessa
Let me get this straight, your problem is that customers that have already been unlocked are showing up, so is there a date field in this Task table? in that case you just want to run the filter on the last customers calls?
– Júlio Neto