home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / bit / listserv / sasl / 3992 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.7 KB  |  59 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!UWPG02.BITNET!CLARK
  3. X-Envelope-to: sas-l@ualtavm.bitnet
  4. X-VMS-To: in%"sas-l@ualtavm.bitnet"
  5. MIME-version: 1.0
  6. Content-transfer-encoding: 7BIT
  7. Message-ID: <01GOBICQFB0Y9UMXZ5@uwpg02.uwinnipeg.ca>
  8. Newsgroups: bit.listserv.sas-l
  9. Date:         Wed, 2 Sep 1992 18:53:26 -0600
  10. Reply-To:     Jim Clark <CLARK@UWPG02.BITNET>
  11. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  12. From:         Jim Clark <CLARK@UWPG02.BITNET>
  13. Subject:      Re: Finding non-dups via SQL
  14. Lines: 43
  15.  
  16. Hi
  17.  
  18.      I just played with the problem of finding non-duplicated records in two
  19. different files.  Below are the SQL commands to list non-duplicated records
  20. from each file.  I hope they are self-explanatory and that this is what the
  21. poster was looking for.  I am an SQL novice (lower than that if I could think
  22. of a word), so any suggestions for better solution would be welcome.
  23.  
  24.  
  25. Best Wishes
  26. Jim
  27.  
  28. James M. Clark                  CLARK@UWPG02.BITNET  (note ZERO-TWO)
  29. Department of Psychology        CLARK@UWPG02.UWINNIPEG.CA
  30. University of Winnipeg          (204) 786-9359
  31. Winnipeg, Manitoba, Canada
  32. R3B 2E9
  33.  
  34.  
  35. title 'Eval Courses NOT IN Class Courses';
  36. select distinct e.ident, e.ins
  37.   from work.check e, f.course c
  38.   where e.ident not in
  39.     (select c.ident
  40.      from f.course c)
  41.   order by e.ident;
  42.  
  43. title 'Class Courses NOT IN Eval Courses';
  44. select distinct *
  45.   from f.course c
  46.   where c.ident not in
  47.     (select e.ident
  48.      from work.check e)
  49.   order by c.ident;
  50.  
  51.  
  52.      Here is how to list matching records.
  53.  
  54. title 'Eval Courses IN Class Courses';
  55. select distinct e.ident, e.ins, c.desc, c.instr
  56.   from work.check e, f.course c
  57.   where e.ident = c.ident
  58.   order by ident, ins;
  59.