Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: subquery with NOT IN

    I'm using Pervasive 2000i SQL with Platinum for Windows. When I try to run the following query, it gets hung up like it is stuck in a loop.

    Can anyone tell me what I have done wrong?

    SELECT custkey, custname, shipaddr1, invdate, agedate, invno, doctot, reference
    FROM "ARHDRH"
    where location = 'RAL' and (arhdrh.invno not in (SELECT arhdrh. invno FROM "ARHDRH", "ARTRANH"
    where arhdrh.invno = artranh.applytodocno)

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    How long have you let it run? How many records are in the tables? What's probably happening is a temporary sort file is being created.
    How long does the subquery (SELECT arhdrh. invno FROM "ARHDRH", "ARTRANH" where arhdrh.invno = artranh.applytodocno) take?
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Feb 2004
    Posts
    2
    The subquery itself just takes a few minutes, I left the entire query running while I went to lunch, over an hour and it still hadn't returned anything when I got back. When I go into Windows task manager it says "not responding".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •