Reputation: 2699
I have a table called table
with column called column
with datatype text
with values like '["1","2"]
'.
I need to get all records which has "1" as one of the element.
select *
from table
where column.....?
How should the where clause be?
Upvotes: 1
Views: 57
Reputation: 44696
Simply use LIKE
. Keep the double quotes to pass 1, but avoid other numbers containing that digit.
select *
from table
where column like '%"1"%'
Upvotes: 1