I will have to consider trying the JOIN method, but I got it working with NOT EXISTS. For some reason my dialect of SQL did not lie NOT IN.
Thanks for everyone's help ... Eric Eric Tishler Software Architect Resolute Partners, LLC Phone: 203.271.1122 Fax: 203.271.1460 [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert martin Sent: Thursday, March 18, 2004 4:30 PM To: [EMAIL PROTECTED]; NZ Borland Developers Group - DelphiList Subject: Re: [DUG] Programming in Delphi, but have a SQL question Agreed. I think using a JOIN method is faster than doing a sub select (might be significant for a large data set). Rob Martin Software Engineer phone 03 377 0495 fax 03 377 0496 web www.chreos.com ----- Original Message ----- From: "Paul Ritchie" <[EMAIL PROTECTED]> To: "'NZ Borland Developers Group - Delphi List'" <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 10:17 AM Subject: RE: [DUG] Programming in Delphi, but have a SQL question > I would tend to use an outer join where the JOINed master column is NULL eg > > SELECT Subset.* > FROM Subset > LEFT OUTER JOIN Master ON Subset.ID = Master.ID > WHERE Master.ID IS NULL > > cheers, > Paul. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Eric Tishler > Sent: Friday, 19 March 2004 9:46 a.m. > To: NZ Borland Developers Group - Delphi List > Subject: [DUG] Programming in Delphi, but have a SQL question > > > I am trying to implement a new report in Delphi, but I am having problems > with the query. I know this is not a straight Delphi question, but I was > hoping someone here could steer me in the right direction. > > I have two tables with transactions. One table contains ALL transactions, > the second table is a subset of the first with only a specific set of > transactions. The columns differ between the two tables, but there is enough > relational information for me to match all of the subset transactions with > the master transaction table. > > In some odd cases the subset transaction is inserted, but the corresponding > entry is not added to the master transaction table. > > I need to write a query that shows which transactions in the subset table do > not appear in the master table. > > Can someone help me with this? > > Thanks, > > Eric > > > Eric Tishler > Software Architect > Resolute Partners, LLC > Phone: 203.271.1122 > Fax: 203.271.1460 > [EMAIL PROTECTED] > > ---------------------------------------------------------------------------- ---- > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
