查找相关两行数据
如下表:程序代码:
create cursor b1 (m1 n(3),m2 c(3)) insert into b1 values (4," ") insert into b1 values (1,"A") insert into b1 values (0,"A") insert into b1 values (1," ") insert into b1 values (3," ") insert into b1 values (4,"") insert into b1 values (2,"A") insert into b1 values (6," ") insert into b1 values (8," ") insert into b1 values (2,"A")
查找m2含A,并筛选出此行和相关的上一行数据,得到如下数据:
程序代码:
create cursor b1 (m1 n(3),m2 c(3)) insert into b1 values (4," ") insert into b1 values (1,"A") insert into b1 values (0,"A") insert into b1 values (4,"") insert into b1 values (2,"A") insert into b1 values (8," ") insert into b1 values (2,"A")
[/color]
应如何进行?谢谢!
[此贴子已经被作者于2021-8-13 18:41编辑过]