Re: Correlated Query problem with large tables



Yes, in that case go for a join. Jet tends to be optimised
for the ANSI joins.

(david)

"Cadences" <Cadences@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B6F0BE0E-D361-4F1E-BC37-7B60A026AB08@xxxxxxxxxxxxxxxx
Sorry, being vague: Doesn't work = The query runs for hours without
producing a result. I get the green 'Running Query' message which fills to
the right but the query never finsihes.
Correlated, as I'd used it before in Oracle a long time ago.
I'll have a look at Joins.
Thanks for your help
Steve






"david epsom dot com dot au" wrote:

What do you mean by 'doesn't work'?

BTW, Access/Jet prefers you to do a Join instead of correlated subquery.
Unless you have some reason, you should consider just re-writing that
as a join between a and b.

(david)

"Cadences" <Cadences@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:77B35751-ADB6-467D-AC8D-ACDF82E215ED@xxxxxxxxxxxxxxxx
I'm new to newsgroups, I've been struggling with this problem.
Any help appreciated.

Orders is a distinct list of Customers + Stock Numbers showing what
they've
ordered. ReducedStockList are priority items.

I'm trying find out stock numbers from ReducedStockList that Customers
haven't ordered i.e not in the Orders table

The query below works with an Orders table of a few hundred rows but
doesn't work with > 10000 rows. Suspect problem is with the use of 'not
in'

SELECT DISTINCT a.[Branch Ac], b.CatNumber
FROM Orders AS a, ReducedStockList AS b
WHERE (((b.CatNumber) Not In (select catnumber from Orders where
[Branch
Ac]
= a.[Branch Ac])))
ORDER BY a.[Branch Ac], b.CatNumber;

can anyone help?
Thanks






.



Relevant Pages

  • Re: Open a form from a record in Querry result or Table
    ... David assume for our discussion that you have a form and it is set to ... datasheet view and this form is based on the select query you mentioned ... the first form so that it opens your tab form and only display the one ... Private Sub Form_DblClick ...
    (microsoft.public.access.gettingstarted)
  • Re: ADVANCED: Suppressing "Save Layout?" dialog on form close
    ... I have the "Allow Design Changes" property set to ... Since the fields inside the query always load with the same width, ... OnUnload events both on the query's datasheet and the form but when the ...
    (microsoft.public.access.formscoding)
  • Re: Index Seek (or) Index Scan in Execution Plan
    ... > Prabhat wrote: ... >> Thanks David for your Suggestion. ... run a simpel query on the table ... > by a bookmark lookup operation (you need to include the second unindexed ...
    (microsoft.public.sqlserver.server)
  • Re: Index Seek (or) Index Scan in Execution Plan
    ... > Prabhat wrote: ... >> Thanks David for your Suggestion. ... run a simpel query on the table ... > by a bookmark lookup operation (you need to include the second unindexed ...
    (microsoft.public.sqlserver.programming)
  • Re: Setting SQL for queries using Visual Basic
    ... GlobalSign digital certificate is a forgery and should be deleted without ... "David Cleave" wrote in message ... > It doesn't work, I assume because the query is not open at the time, and ... before I can modify its SQL? ...
    (microsoft.public.access.queries)