Yes, you're right Bill, it does work - many thanks - and in seconds rather than the hour or more my feeble attempt took to get it wrong..
Now to try and follow through the logic to understand it. Thanks & regards, Alastair. ----- Original Message ----- From: "Bill Downall" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, September 09, 2003 3:50 PM Subject: [RBASE-L] - Re: Finding unused id codes > On Tue, 09 Sep 2003 09:39:42 -0500, Bill Downall wrote: > > >SELECT codecolumn + > > FROM lookuptable t1 + > > WHERE NOT EXIST + > >(SELECT codeslistcolumn FROM datatable d2 + > > WHERE d2.codeslistcolumn CONTAINS t1.codecolumn) > > It does work, in my little test: > > R>load tempcodes > Begin R:BASE Data Loading for tempcodes > L>AA > L>AB > L>AC > L>AD > L>AE > L>AF > L>AG > L>end > End R:BASE Data Loading > R>create table tempData (TempData text (20)) > R>load tempdata > Begin R:BASE Data Loading for tempdata > L>'AA,AC,AE,AG' > L>end > End R:BASE Data Loading > R>sel * from tempcodes t1 where not exist (select * from tempdata d2 + > where d2.tempdata contains t1.tempcode) > tempcode > -------- > AB > AD > AF > R> >

