Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id UAA18519 for postgres-redist; Sun, 5 Nov 1995 20:17:08 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199511060417.UAA18519@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from staff.cs.su.OZ.AU (staff.cs.su.OZ.AU [129.78.8.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id UAA17718 for <postgres@postgres.berkeley.edu>; Sun, 5 Nov 1995 20:17:05 -0800
Received: from stone.oz.au by staff.cs.su.OZ.AU (mail from daryl for
	postgres@postgres.berkeley.edu)
	with MHSnet (insertion MHSnet site: odtdev.rnd.stone.oz.au); Mon, 06 Nov 1995 15:16:36 +1100
From: daryl@stone.oz.au (Daryl Sayers)
X-Mailer: SCO System V Mail (version 3.2)
To: postgres@postgres.Berkeley.EDU
Date: Mon, 6 Nov 95 10:41:44 AEST
Message-ID: <9511061041.aa16227@odtdev.stone.oz.au>
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Sun, 05 Nov 95 20:17:07 -0800
Resent-XMts: smtp

Newsgroups: stone.mlist.postgres
Path: daryl
From: daryl@stone.oz.au (Daryl Sayers)
Subject: Re: Simple retrieve question
Organization: Stone Microsystems, NSW, Australia
Date: Mon, 6 Nov 1995 00:41:37 GMT
Message-ID: <DHLJ9D.CI9@stone.oz.au>
X-Newsreader: NN version 6.5.0 #3
References: <9511031223.aa22499@odtdev.stone.oz.au>

>O.K. call me lame, but I can't figure it out.....

>I have 2 classes, One for Company info and 1 for Contacts.
>For every Contact record there is an id that points to the
>Company it belongs to. My questions how can I retrieve all
>the Companys that do not have a Contact record.

O.K. Here is some more information as the kind souls that answered
me all suggested similar ideas that I had already tried.

retrieve (u.name)
	from u in company, v in contact 
	where u.id != v.id

This doesnt work because it goes through all the Companys and checks against
all Contacts.

example:
Class Company			Class Contacts
id	Company			id	Contact
1	AAAA			1	Fred Dag
2	BBBB			1	Joe Bloggs
3	CCCC			3	Pete Smith

The command above will produce a list:
(u.id != v.id)
( 1   != 1   ) Dont Print AAAA
(u.id != v.id)
( 2   != 1   ) **** Print BBBB      BBBB
(u.id != v.id)
( 3   != 1   ) **** Print CCCC      CCCC
(u.id != v.id)
( 1   != 1   ) Dont Print AAAA
(u.id != v.id)
( 2   != 1   ) **** Print BBBB      BBBB
(u.id != v.id)
( 3   != 1   ) **** Print CCCC      CCCC
(u.id != v.id)
( 1   != 3   ) **** Print AAAA      AAAA
(u.id != v.id)
( 2   != 3   ) **** Print BBBB      BBBB
(u.id != v.id)
( 3   != 3   ) Dont Print CCCC

I am using postgres4.2
-- 
Daryl Sayers                              Ph: (02) 417 3788
Stone Group Asia Pacific                 Fax: (02) 417 3741
Unit 20, 380 Eastern Valley Way        Email: daryl@stone.oz.au
Roseville, 2069 NSW Australia            WWW: http://sydney.DIALix.com/~stone

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
