# How to get exclude of 2 columns of one table with another table

**URL:** <https://forum.kx.com/t/how-to-get-exclude-of-2-columns-of-one-table-with-another-table/11429>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [December 7, 2016, 4:54pm UTC](https://forum.kx.com/t/how-to-get-exclude-of-2-columns-of-one-table-with-another-table/11429 "2016-12-07T16:54:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carfield11](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@carfield11](https://forum.kx.com/u/carfield11)\
**Post date:** [December 7, 2016, 4:54pm UTC](https://forum.kx.com/t/how-to-get-exclude-of-2-columns-of-one-table-with-another-table/11429/1 "2016-12-07T16:54:00Z")

</div>

If I like to find the record of one table with a column not from a column from another table, I can do the following:

&nbsp; select from t1 where not&nbsp;col1 in exec col1 from t2

but if I like to exclude with 2 ( or more&nbsp;) how can I do?

&nbsp;

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [December 7, 2016, 5:16pm UTC](https://forum.kx.com/t/how-to-get-exclude-of-2-columns-of-one-table-with-another-table/11429/2 "2016-12-07T17:16:00Z")

</div>

q)t1:(`a`b`c;y:0 1 2;z:3 4 5)

q)t2:(`a`b`d;y:0 1 2;z:6 7 8)

q)select from t1 where not (x;y)in select x,y from t2

x y z

* * *

c 2 5

---

<div class="post-metadata">

**Author:** ![carfield11](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@carfield11](https://forum.kx.com/u/carfield11)\
**Post date:** [December 8, 2016, 11:31am UTC](https://forum.kx.com/t/how-to-get-exclude-of-2-columns-of-one-table-with-another-table/11429/3 "2016-12-08T11:31:00Z")

</div>

Thanks a lot Charles, I should know it before asking
