get distinct records in a table not in memory mapped table

Consider two tables T1 and T2. T1 is a relatively small table entirely in memory, and T2 is a large on-disk memory mapped table. I need to do soemthing like this:

<transfer records from T1 to a temporary table TT1 such that colA,colB in T1 do not exist already in TT1 or T2>

<save TT1 to T2>

Can you give an example how to execute such a query?

thanks

assuming no cleverness with keys:

TT1,:select <whatever> from T1 where not ( colA;colB) in (select colA,colB from TT1)

/ you can use upsert semantics as well (example in q for mortals I/O chapter), but this is an example of date-partition read/join/write for a date-partition table

TableName:(timesym xcols TT2),TT1

.Q.dpft[`:/disk/location;2012.01.01;`sym;`TableName]

Thanks. I was able to accomplish this task with a set of queries and using “by”.