不知道哪里有错误?谢谢!

dyeerp 2008-09-04 11:07:12
declare @FID int,
@j int
select @j=max(FID) from Smp_EngMaterial
if isnull(@j,0)=0 select @j=10000
while exists((select 1 from Smp_EngMaterial where FID=@j) or (select 1 from Smp_EngineBill where FInterID=@j))
begin
set @j=@j-1
end
set @FID=@j
...全文
56 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fcuandy 2008-09-04
  • 打赏
  • 举报
回复
while exists(
select 1 from Smp_EngMaterial where FID=@j
union
select 1 from Smp_EngineBill where FInterID=@j
)
ybkenan 2008-09-04
  • 打赏
  • 举报
回复
while ( exists (select 1 from Smp_EngMaterial where FID=@j) or exists (select 1 from Smp_EngineBill where FInterID=@j) )
pengxuan 2008-09-04
  • 打赏
  • 举报
回复
while exists((select 1 from Smp_EngMaterial where FID=@j) or (select 1 from Smp_EngineBill where FInterID=@j))
这句不应该这样用吧
jobine 2008-09-04
  • 打赏
  • 举报
回复
declare @FID int, 
@j int
select @j=max(FID) from Smp_EngMaterial
if isnull(@j,0)=0 select @j=10000
while exists((select 1 from Smp_EngMaterial where FID=@j)) or exists(select 1 from Smp_EngineBill where FInterID=@j)
begin
set @j=@j-1
end
set @FID=@j

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧