从 table KDB+/Q 中删除重叠条目

remove overlapping entries from a table KDB+/Q

我有两个表,分别是表 1 和表 2。两者都有日期和 id 作为列,table2 是 table1 条目的一个小子集。如何通过匹配日期和 ID 从 table1 中删除 table2 中存在的所有条目?

select from table1 where not([]date;id)in table2
/ Begin with example input of 10 entries 
q)t1:([]date:.z.d+til 10;id:til 10;c:til 10)
/ Pick 3 random entries to form key table t2
q)t2:3?delete c from t1
/ Key t1 by date and id and drop entries matching t2
q)t2 _ `date`id xkey t1