iWheelBuy
iWheelBuy

Reputation: 5679

sqlite FTS query issue

That's my query:

SELECT firstName, lastName FROM users WHERE users MATCH 'firstName:joh*'

I want to get all rows where lastName's length is 1+ (not null)

How should I modify my query?

Upvotes: 1

Views: 307

Answers (1)

CL.
CL.

Reputation: 180010

This cannot be done with FTS; just use a normal expression:

SELECT firstName, lastName
FROM users
WHERE users MATCH 'firstName:joh*'
  AND length(lastName) >= 1

(Please note that NULL and '' (empty string) are distinct values, and are both excluded.)

Upvotes: 1

Related Questions