home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!UWPG02.BITNET!CLARK
- X-Envelope-to: sas-l@ualtavm.bitnet
- X-VMS-To: in%"sas-l@ualtavm.bitnet"
- MIME-version: 1.0
- Content-transfer-encoding: 7BIT
- Message-ID: <01GOBICQFB0Y9UMXZ5@uwpg02.uwinnipeg.ca>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 2 Sep 1992 18:53:26 -0600
- Reply-To: Jim Clark <CLARK@UWPG02.BITNET>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Jim Clark <CLARK@UWPG02.BITNET>
- Subject: Re: Finding non-dups via SQL
- Lines: 43
-
- Hi
-
- I just played with the problem of finding non-duplicated records in two
- different files. Below are the SQL commands to list non-duplicated records
- from each file. I hope they are self-explanatory and that this is what the
- poster was looking for. I am an SQL novice (lower than that if I could think
- of a word), so any suggestions for better solution would be welcome.
-
-
- Best Wishes
- Jim
-
- James M. Clark CLARK@UWPG02.BITNET (note ZERO-TWO)
- Department of Psychology CLARK@UWPG02.UWINNIPEG.CA
- University of Winnipeg (204) 786-9359
- Winnipeg, Manitoba, Canada
- R3B 2E9
-
-
- title 'Eval Courses NOT IN Class Courses';
- select distinct e.ident, e.ins
- from work.check e, f.course c
- where e.ident not in
- (select c.ident
- from f.course c)
- order by e.ident;
-
- title 'Class Courses NOT IN Eval Courses';
- select distinct *
- from f.course c
- where c.ident not in
- (select e.ident
- from work.check e)
- order by c.ident;
-
-
- Here is how to list matching records.
-
- title 'Eval Courses IN Class Courses';
- select distinct e.ident, e.ins, c.desc, c.instr
- from work.check e, f.course c
- where e.ident = c.ident
- order by ident, ins;
-