Slight progress but no idea why!

Three ways that don't work (too slow):

SELECT MIN(OrdNo) FROM Orders WHERE OrdNo > cLastPONum

SELECT TOP 1 OrdNo FROM Orders WHERE OrdNo > cLastPONum ORDER BY OrdNo ASC

SELECT * FROM Orders WHERE OrdNo IN ;
        (SELECT TOP 1 OrdNo FROM Orders WHERE OrdNo > cLastPONum ;
        ORDER BY OrdNo ASC)


And one way that does work:
SELECT OrdNo FROM Orders WHERE OrdNo > cLastPONum ORDER BY OrdNo INTO CURSOR
Temp1
cOrdNo = Temp1.OrdNo

However put a MIN, MAX or TOP 1 on and it goes excruciatingly slow again.

Nick




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/!&!AAAAAAAAAAAYAAAAAAAAAOO2KhH5xw1Oq9ETMzh8UaqijQAAEAAAADNUeJXM9AFLqh8xI0/[EMAIL
 PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to