Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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''%'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading