Home > Blockchain >  How to get value from row when its stored as an array in SQL
How to get value from row when its stored as an array in SQL

Time:11-17

pkid | columnValue
1     ('1', '11')
2     ('2', '11')

My table is called tbl.

I have this for a table and I need to be able to have a select statement that will only bring out the columnValue that has '1'. My problem is that I can't use LIKE and wildcard as it'll just bring out both rows.

When I do WHERE columnValue = '1' it doesnt return anything

CodePudding user response:

Because your data is delimited with quotes you can include those delimiters in your criteria by escaping them in the string:

where columnvalue like '%''1''%'
  •  Tags:  
  • sql
  • Related