Category : Paradox DBMS
Archive   : TECH91.ZIP
Filename : TI784.ASC

 
Output of file : TI784.ASC contained in archive : TECH91.ZIP







PRODUCT : Paradox NUMBER : 784
VERSION : 3.0 & up
OS : DOS
DATE : September 11, 1991 PAGE : 1/3

TITLE : Doing "Not-In" Queries in Paradox




This query is made to ask the question "What records exist in one
table that do NOT exist in another?" The following is a general
example method for creating "Not-In" queries.

Notice that this example uses the COUNT operation and it does not
use NOT or NO. For the examples, an underscore character will be
used in place of the [F5] key to indicate an example element in
the query.

First create tables with the structures shown below.

CUSTOMERËÍÍÍÍCust #ÍÍÍÍÍËÍÍÍÍLast NameÍÍÍÍÍËÍÍÍÍFirst NameÍÍÍÍ»
1 º 1015 º Elkins º Eugene º
2 º 1020 º Fenton º Mark º
3 º 1055 º Harding º Jim º
4 º 1056 º Wilden º Marc º
5 º 1319 º Fenton º Teresa º
6 º 1341 º Goves º Cynthia º
7 º 1342 º Goves º Joseph º
8 º 1685 º Moon º Yvonne º
9 º 1988 º Martinez º Susan º
10 º 2022 º Staebell º Alice º


ORDERSÍËÍÍÍÍOrder #ÍÍÍÍËÍÍÍÍÍDateÍÍÍÍÍËÍÍÍÍCust #ÍÍÍÍÍËPart #Ë
1 º 1 º 7/09/89 º 1015 º DR º
2 º 2 º 7/09/89 º 1341 º WR º
3 º 3 º 7/09/89 º 1685 º HA º
4 º 4 º 7/28/89 º 1988 º HA º
5 º 5 º 8/01/89 º 2022 º WR º
6 º 6 º 8/03/89 º 1988 º GH º
7 º 7 º 8/04/89 º 1341 º DR º
8 º 8 º 8/14/89 º 1055 º VI º
9 º 9 º 8/15/89 º 1020 º DR º
10 º 10 º 8/16/89 º 1341 º GH º
11 º 11 º 8/18/89 º 1015 º TB º
12 º 12 º 8/21/89 º 1685 º TB º

(The next table is a continuation of the above orders table)

ORDERSÍËÍÍÍÍÍÍPriceÍÍÍÍÍÍÍË
1 º 46.20 º














PRODUCT : Paradox NUMBER : 784
VERSION : 3.0 & up
OS : DOS
DATE : September 11, 1991 PAGE : 2/3

TITLE : Doing "Not-In" Queries in Paradox




2 º 3.96 º
3 º 12.04 º
4 º 12.04 º
5 º 3.96 º
6 º 14.52 º
7 º 46.20 º
8 º 65.93 º
9 º 46.20 º
10 º 14.52 º
11 º 33.66 º
12 º 33.66 º

The query shown below is how to ask the question "Which customers
have never placed an order?". This query works for the following
reasons. First, it uses the 'inclusion operator' which is the
exclamation point in the [Cust #] field of the CUSTOMER
table. This tells Paradox to consider every customer number,
whether or not it is found in the ORDERS table.

Next, the ORDERS table contains the expression "count=0" in the
[Cust #] field. This tells Paradox to count the number of
occurrences of each customer number in the ORDERS tables, and
only include those which occur zero times. In other words, show
the customers who have not placed any orders, or show everything
in the CUSTOMER table that is NOT in the ORDERS table.

ORDERSÍËOrder #ÍËÍÍDateÍÍÍËÍÍÍÍCust #ÍÍÍÍËÍPart #ÍÍËÍÍPriceÍÍÍ»
º º º _c,count=0 º º º
º º º º º º
º º º º º º


CUSTOMERËÍCust #ÍËÍLast NameÍÍËÍFirst NameÍ»
ºû _c! º º º
º º º º
º º º º


ANSWERÍËÍÍCust #ÍÍÍ»
1 º 1056 º
2 º 1319 º
3 º 1342 º














PRODUCT : Paradox NUMBER : 784
VERSION : 3.0 & up
OS : DOS
DATE : September 11, 1991 PAGE : 3/3

TITLE : Doing "Not-In" Queries in Paradox




To help understand how this query works, try changing the
"count=0" to a "calc count all". The ANSWER that will be
returned will have 10 records, since there are 10 records in the
CUSTOMER table. The number shown will be the number of times
each customer appears in the ORDERS table. And you will see that
the records 1056, 1319 and 1342 show a count of zero, which are
the answer to the above query.

The information in this document came from Brian J. Smith's
article "How To Ask 'Not-In' Queries" which first appeared in the
October 1989 issue of "Instant Scripts", a publication of the
LAPALS user group in Southern California.







































  3 Responses to “Category : Paradox DBMS
Archive   : TECH91.ZIP
Filename : TI784.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/