Forum Discussion

Shivshankar's avatar
8 years ago

Like query in LiQL

Hi !

 

I am trying to fetch subject of all messages in particular board with certain keyword , formed this LiQL query

 

SELECT id,subject FROM messages WHERE board.id = '4' and subject MATCHES 'Batch'

The problem is , this "MATCHES" gives result of only those subject which have exact "Batch" as a word in them and won't give subject containing "BatchUpdate" as result . I want something which works similar to LIKE function in MYSQL for other database query languages.

Can someone provide with some kind of input to achieve this.

 

  • VikasB's avatar
    VikasB
    8 years ago

    Hi srujanayeruvaka  
    Did you notice it would not work if you are not using the braces surrounding to the text which RobertT missed in their post?  But it works fine with braces.

    SELECT * FROM messages WHERE board.id = 'XYZ' and subject MATCHES ('batch*')

    Shivshankar  have a look, it really works.

15 Replies