KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Brand New to qSql

  • Brand New to qSql

    Posted by mkoon on May 6, 2022 at 12:00 am

    Just got started with qsql.

    how to I compare 2 columns of type string.

    childID and parentID are of type string

    select from data where childID like parentID

     

     

    mkoon replied 9 months, 1 week ago 3 Members · 2 Replies
  • 2 Replies
  • Laura

    Administrator
    May 7, 2022 at 12:00 am

    If its an exact match you can use Match Each ~'.

     

    select from data where childID ~’ parentID

     

     

  • davidcrossey

    Member
    May 9, 2022 at 12:00 am

    If it’s not an exact match, you could wrap the second column in wildcards characters and use Like Each like'

    select from data where childID like’ (“*”,’parentID,'”*”)

    Note – this assumes that the parentID has less characters than childID

Log in to reply.