datashout
datashout

Reputation: 147

How to query keywords in a comment in postgresql

I havea table with a string column:

    text
I have two cars
I have a big house

I want to query from this table only records that has the word cars

the expected output:

I have two cars

I tried:

select text from tlb
where text in ('cars') 

but it only returns exactly 'cars'

Postgresql V14

Upvotes: 1

Views: 60

Answers (1)

gameiplay0
gameiplay0

Reputation: 61

LIKE operator could help.

select * from tlb where lower(texts) like '%cars%';

Upvotes: 1

Related Questions