Muddu Patil
Muddu Patil

Reputation: 721

Like operation selecting only one row in SQLite

I'm working on SQLite and I want use the LIKE operation in my query and i've used following query

SELECT * from TBL_words where words Like "%ab" 

I've more than 10 words which are ends with ab but I'm getting only one word. Am I doing anything wrong? please any one suggest the solution for this, Thanks

Upvotes: 0

Views: 46

Answers (1)

laalto
laalto

Reputation: 152867

LIKE '%ab' will match columns that end exactly in the chars ab. Based on comments you have additional trailing whitespace in some of your words. You can use TRIM(words) in SQL to remove it.

Upvotes: 1

Related Questions