楼主 最后可能需要把 VIEW 中SQL , 替换掉 最终 SQL 里面的那个 VIEW
第一步, 首先把 A 表, 按 A1 A2 排序,并设置编号
CREATE VIEW v_test_a AS
SELECT
ROW_NUMBER() OVER (ORDER BY A1, A2) AS NO,
A1,
A2,
A3
FROM
test_xfsy_a
1>select * from v_test_a
2>go
NO A1 A2 A3
-------------------- ---------- ---------- ----------
1 9-30 02:30 1-4
2 9-30 02:56 1-5
3 9-30 03:25 1-6
(3 行受影响)
第二步,2个带编号的A表关联,得到一个 开始时间,结束时间的 “A表”
CREATE VIEW v_test_a_step2 AS
SELECT
aa.a1 AS begin_a1,
aa.a2 AS begin_a2,
ab.a1 AS end_a1,
ab.a2 AS end_a2,
aa.a3
FROM
v_test_a aa,
v_test_a ab
WHERE
aa.no = ab.no - 1
1>select * from v_test_a_step2
2>go
begin_a1 begin_a2 end_a1 end_a2 a3
---------- ---------- ---------- ---------- ----------
9-30 02:30 9-30 02:56 1-4
9-30 02:56 9-30 03:25 1-5
(2 行受影响)
第三步, ABC 关联
1>SELECT
2> a.a3,
3> b.b1,
4> b.b2,
5> b.b3,
6> c.c2,
7> c.c3
8>FROM
9> test_xfsy_b AS b,
10> test_xfsy_c AS c,
11> v_test_a_step2 AS a
12>WHERE
13> b.b1 >= a.begin_a1 AND b.b1 <= a.end_a1
14> AND b.b2 >= a.begin_a2 AND b.b2 <= a.end_a2
15> AND a.a3 = c.c1
16>go
a3 b1 b2 b3 c2 c3
---------- ---------- ---------- ----------- ----------- -----------
1-49-30 02:31 25 30 13
1-49-30 02:32 25 30 13
(2 行受影响)
第一步,创建静态页面select.html,引入select2相关的css和js文件,并引入jQuery核心js,如下图所示:第二步,在body标签内插入select元素,设置属性multiple和class,宽度为300px,如下图所示:第三步,初始化select2插件欢迎分享,转载请注明来源:内存溢出
评论列表(0条)