日期:2014-05-16  浏览次数:20933 次

asp+access查找记录的问题请教高手


比如:第一条记录为15,第二条记录为6,在记录中查找15->6后的数字,也就是8

请大家帮帮忙,想好长时间都不知道怎么弄
------解决方案--------------------
这个需要用内连接.
access忘了怎么做,sql server的我写过.

select t3.xuhao, t3.jiegouzs from 表 t1
inner join (
select xuhao+1 as xuhao,jieguozs from biao )
t2
on t1.xuhao = t2.xuhao
inner join ( select xuhao+3 as xuhao,jieguozs from biao )
t3
on t1.xuhao = t3.xuhao
where t1.jiegouzs =15
and t2.jiegouzs=6

access记得好像不能用子查询,需要先建立查询后,就可以了.
------解决方案--------------------
select t3.xuhao, t3.jiegouzs from 表 t1
inner join (
select xuhao-1 as xuhao,jieguozs from biao )
t2
on t1.xuhao = t2.xuhao
inner join ( select xuhao-2 as xuhao,jieguozs from biao )
t3
on t1.xuhao = t3.xuhao
where t1.jiegouzs =15
and t2.jiegouzs=6

应该是减号,笔误