-5

Edited: How to query records containing certain number, USING REGEXP?

Data base:

id | number
1 | ["5","8","9","19","1"]
2 | ["2","3","8","11","10"]
3 | ["1","14","3","22","15"]
4 | ["20","8","4","6","7"]
5 | ["3","9","14","20","10"]

In sql, how to query only the records that have the number 8, for example? (Id's 1, 2 and 4)

4

1 回答 1

2

你没有告诉我们数据类型号是什么,所以我假设它是文本。

Select * from mytable
Where number like '%"8"%'
于 2012-11-19T22:28:43.533 回答