I am using DBF database in a C++ project written on RAD Studio 10.2 Tokyo. To make request on this database, I am using UniDac Devart component (that is a little bit limited compared to MySQL itself). The problem I have is when using WHERE IN condition in the request, the request makes too much time to be execute (more than one hour sometimes).
This is the request I have :
SELECT accountrp, SUM(amounteur) AS montant FROM %s
WHERE doctype='1' AND period<>'00' AND
matchno IN(SELECT matchno FROM %s GROUP BY matchno HAVING SUM(amounteur)<>0)
GROUP BY accountrp
accountrp, doctype, period are character and amounteur is numeric.
The problem is around the line matchno IN. I would like to optimize the request without using IN. I saw on Internet that WHERE IN condition can be replaced by INNER JOIN junctions but I Don't know if it is the solution and how to do this.
Can you help me, please ?