Time for running a Query too long!

  • Thread starter Thread starter MonaNeedHelp
  • Start date Start date
M

MonaNeedHelp

Guest
Hello!

I have a big problem, I have a Query on a table "Cheque" that has about 50 000 entries. And it is very long to process, about 15 seconds... so I need to optimize it! If anybody could help me, it would be appreciated. Here's my query:

SELECT Cheque.noCheque, Cheque.percepteur, Cheque.refNSF
FROM Cheque
WHERE Cheque.percepteur<>"Fiducie" AND Cheque.refNSF Not In (SELECT c2.idCheque FROM Query2 AS c2)​

(it is a little bit longer and has a ORDER BY part, but I simplified it)

And the "Query2" is

SELECT Cheque.idCheque, Cheque.percepteur, Cheque.refNSF
FROM Cheque
WHERE Cheque.NSF=-1 AND Cheque.percepteur="HN_Frais";​

The THING IS that the result has to be editable!
I tried with a IN instead of a NOT IN, inversing the Query2, but they are much more result for Query2 so it is not faster.

Thanks for ANY help!
 
Hi!

Thanks, it gives the right answer and it's fast! :)

BUT it is still not editable... :mad:
 

Users who are viewing this thread

Back
Top Bottom