Ms access 如何在MS Access中查找表中的第一个可用值

Ms access 如何在MS Access中查找表中的第一个可用值,ms-access,Ms Access,在SQLServer2008中,我在具有以下存储过程的表中找到第一个可用插槽 If Exists ( Select * From Methods Where MethodSerno =1 ) Select @SlotCode = Min(MethodSerno) + 1 From Methods Where MethodSerno + 1 Not In ( Select MethodSerno From Methods ) MS Access中是否有等效的方

在SQLServer2008中,我在具有以下存储过程的表中找到第一个可用插槽

If Exists ( Select *  From Methods  Where MethodSerno =1 )  
   Select @SlotCode = Min(MethodSerno) + 1  
   From Methods  
   Where MethodSerno + 1 Not In ( Select MethodSerno  From Methods )
MS Access中是否有等效的方法


感谢您提供一个名为[Methods]的包含行的表…

MethodSerno ------ 1. 2. 4. 5. 8. 10 我们可以从一个查询开始,查找没有直接后继n+1的每个值

选择t1.MethodSerno 从…起 方法t1 左连接 方法t2 关于t1.MethodSerno+1=t2.MethodSerno 其中t2.MethodSerno为空 返回

MethodSerno ------ 2. 5. 8. 10 第一个可用值将只是这些值中的最小值+1

选择MINt1.MethodSerno+1作为下一个serno 从…起 方法t1 左连接 方法t2 关于t1.MethodSerno+1=t2.MethodSerno 其中t2.MethodSerno为空 返回

下塞诺 ----- 3.
你能详细说明你想完成什么吗?一旦我们知道,我相信有人会为您提供一个替代方案。Gord感谢您的回复。当我运行为t1.Methods参数值提供的查询访问权限的第一部分时,这些查询对我无效。检查您的SQL语句;你可能打错了,很好,谢谢。我原来的问题中有一个拼写错误被抄袭了