0

I have this issue that i'm stuck in...

I have a field like an array, values separated by space. Let's say we have these values:

v1: "100 150 200 300"
v2: "50 100"
V3: "130 230 415"
v4: "340 500 600"
...

Then i have two user input values like a min and a max, let's say 120 and 300. I need to select with mysql from table all rows that have an array value between these min and max

So the output should be v1 and v3 from the previous example.

Can someone help me, please?

4

2 回答 2

0

我完全同意评论说这是糟糕的设计,但我认为这可以通过将数组拆分为其各自值并结合应用的函数来解决。

这应该会产生一个像

v1 100

v1 150

等等

v2 50

v2 100

等等

从那里问题应该很容易。

于 2013-11-13T18:58:27.233 回答
-1

我会检查这个线程将值从一个字段拆分为两个

或者拉回数据并使用服务器端代码将值拆分为数组,然后进行比较。

于 2013-11-13T18:42:22.237 回答