Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f2D1Glx11582 for ; Mon, 12 Mar 2001 20:16:47 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f29JUGx08733 for ; Fri, 9 Mar 2001 14:30:16 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f29J1K831793 for pgsql-sql@postgresql.org; Fri, 9 Mar 2001 14:01:20 -0500 (EST) (envelope-from news) From: "Alder" X-Newsgroups: comp.databases.postgresql.sql Subject: SQL Dummy Needs Help Date: Fri, 9 Mar 2001 11:05:38 -0800 Lines: 25 X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Message-ID: <3aa9287b@obsidian.gov.bc.ca> To: pgsql-sql@postgresql.org X-Archive-Number: 200103/237 X-Sequence-Number: 1896 I'm pretty new to SQL and can't figure out how to write what should be a simple query of two tables. Could someone here possibly help me out? Table 1 has two fields I'm interested in: TITLE_NO and EFFECT_DATE Table 2 also has two fields of interest: TITLE_NO and PAIDTO_DATE TITLE_NO is unique in Table 1, meaning each TITLE will have a unique EFFECT_DATE. Table 2 represents an accounting history of each TITLE, so for each TITLE_NO there may be one or more PAIDTO_DATE values. In both Tables the _DATE fields are stored as 9-character strings in the fomat YYYYMMDD. In all cases, the MM and DD values in Table 2 should be identical with those in Table 1. My intention is to produce a list that will contain the TITLE_NO of each TITLE where the MMDD value for EFFECT_DATE differ from any of the PAIDTO_DATE values for that TITLE_NO. The list must contain ONLY the PAIDTO_DATE values that differ, and the corresponding TITLE_NO. Sorry I can't explain this a little more technically, but if anyone can advise me, that would be fabulous. Thanks, Terry