# like with table

**URL:** <https://forum.kx.com/t/like-with-table/6704>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [August 26, 2010, 11:03am UTC](https://forum.kx.com/t/like-with-table/6704 "2010-08-26T11:03:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitinvibha](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nitinvibha](https://forum.kx.com/u/nitinvibha)\
**Post date:** [August 26, 2010, 11:03am UTC](https://forum.kx.com/t/like-with-table/6704/1 "2010-08-26T11:03:00Z")

</div>

t1:( c:`symbol$(); t:`symbol$(); indu:`symbol$())

`t1 insert (`gm; `$"LEE LIANG TOO"; `$“Semi conductors”)  
`t1 insert (`gm; `$"AAAAAA BEEES BDFD KEN KONG KA"; `$“Auto mobiles”)  
`t1 insert (`ge; `$"ADEGS SJDG AAADDD"; `$“Diversified Industries”)

t2:( c:`symbol$(); t:`symbol$())

`t2 insert (`gm; `$"KEN KONG KA") `t2 insert (`ge; `$“TEST”)

I want to get all the data where t1.c = t2.c and t1.t like t2.t  
(hardcoded works t1.t like “\*KEN KONG KA\*”)

Pls advise

---

<div class="post-metadata">

**Author:** ![nitinvibha](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nitinvibha](https://forum.kx.com/u/nitinvibha)\
**Post date:** [August 27, 2010, 1:00pm UTC](https://forum.kx.com/t/like-with-table/6704/2 "2010-08-27T13:00:00Z")

</div>

q)xID N NAME---------------------“01” “ABCDEF” "\*ABC\*"q)select from x where N like NAME`typeOn Aug 26, 6:03?pm, kittu <nitinvi...> wrote:&gt; t1:([] c:`symbol$(); t:`symbol$(); indu:`symbol$())\>\> `t1 insert (`gm; `$"LEE LIANG TOO"; `$“Semi conductors”)\> `t1 insert (`gm; `$"AAAAAA BEEES BDFD KEN KONG KA"; `$“Auto mobiles”)\> `t1 insert (`ge; `$"ADEGS SJDG AAADDD"; `$“Diversified Industries”)\>\> t2:( c:`symbol$(); t:`symbol$())\>\> `t2 insert (`gm; `$"KEN KONG KA")&gt; `t2 insert (`ge; `$“TEST”)\>\> I want to get all the data where t1.c = t2.c and t1.t like t2.t\> (hardcoded works t1.t like “_KEN KONG KA_”)\>\> Pls advise\</nitinvi…\>

---

<div class="post-metadata">

**Author:** ![Aaron\_Davies](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Aaron\_Davies](https://forum.kx.com/u/Aaron_Davies)\
**Post date:** [August 27, 2010, 1:02pm UTC](https://forum.kx.com/t/like-with-table/6704/3 "2010-08-27T13:02:00Z")

</div>

X-Mailer: Apple Mail (2.936)

like’

or

any like/:

or something, depending on what exactly you’re trying to do

what you did tries to run

(enlist"ABCDEF")like enlist(“\*ABC\*”)

which doesn’t work

---

<div class="post-metadata">

**Author:** ![nitinvibha](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nitinvibha](https://forum.kx.com/u/nitinvibha)\
**Post date:** [August 28, 2010, 4:37am UTC](https://forum.kx.com/t/like-with-table/6704/4 "2010-08-28T04:37:00Z")

</div>

Thanks for reply. How can i use “like” with table column ?t1:( c:`symbol$(); t:`symbol$(); indu:`symbol$())`t1 insert (`gm; `$“LEE LIANG TOO”; `$"Semi conductors")`t1 insert (`gm; `$“AAAAAA BEEES BDFD KEN KONG KA”; `$"Auto mobiles")`t1 insert (`ge; `$“ADEGS SJDG AAADDD”; `$"Diversified Industries")t2:([] c:`symbol$(); t:`symbol$())`t2 insert (`gm; `$“KEN KONG KA”)`t2 insert (`ge; `$"TEST")I want to get all the data of t1 table where t1.c = t2.c and t1.t liket2.t(hardcoded works t1.t like "\*KEN KONG KA\*")Pls adviseThanksOn Aug 27, 8:02?pm, Aaron Davies <aaron.dav...> wrote:&gt; like'&gt;&gt; or&gt;&gt; any like/:&gt;&gt; or something, depending on what exactly you're trying to do&gt;&gt; what you did tries to run&gt;&gt; (enlist"ABCDEF")like enlist("*ABC*")&gt;&gt; which doesn't work&gt;&gt; On Aug 27, 2010, at 8:00 AM, kittu wrote:&gt;&gt;&gt;&gt;&gt;&gt; &gt; q)x&gt; &gt; ID ? N ? ? ? ?NAME&gt; &gt; ---------------------&gt; &gt; "01" "ABCDEF" "*ABC*"&gt;&gt; &gt; q)select from x where N like NAME&gt; &gt; `type\>\> \> On Aug 26, 6:03 pm, kittu \<nitinvi…\> wrote:\> \>\> t1:( c:`symbol$(); t:`symbol$(); indu:`symbol$())&gt;&gt; &gt;&gt; `t1 insert (`gm; `$“LEE LIANG TOO”; `$"Semi conductors")&gt; &gt;&gt; `t1 insert (`gm; `$“AAAAAA BEEES BDFD KEN KONG KA”; `$"Auto mobiles")&gt; &gt;&gt; `t1 insert (`ge; `$“ADEGS SJDG AAADDD”; `$"Diversified Industries")&gt;&gt; &gt;&gt; t2:([] c:`symbol$(); t:`symbol$())&gt;&gt; &gt;&gt; `t2 insert (`gm; `$“KEN KONG KA”)\> \>\> `t2 insert (`ge; `$“TEST”)\>\> \>\> I want to get all the data where t1.c = t2.c and t1.t like t2.t\> \>\> (hardcoded works t1.t like “_KEN KONG KA_”)\>\> \>\> Pls advise\>\> –\> Aaron Davies\> aaron.dav…@gmail.com- Hide quoted text -\>\> - Show quoted text -\</nitinvi…\>\</aaron.dav…\>
