select b.Time from student a ,teacher b where a.str_StatNoIn=@StartNo
and a.str_StatNoOut=@EndNo

解决方案 »

  1.   

    create proc aa( @StartNo int,@EndNo  int)
    as
    begin
      select b.Time 
      from student a ,teacher b 
      where a.str_StatNoIn=@StartNo
            and a.str_StatNoOut=@EndNo
    end
      

  2.   

    完整点改是不是应该是这样啊!select b.Time from student a ,teacher b where a.str_StatNoIn=@statnoIn,b.@StartNo=@startNo
    a.str_StatNoOut=@statnoout,b.EndNo=@endno @statnoIn=@startNo and @statnoout=@endno
      

  3.   

    哦~~~依照我的SQL语句!照着您的提醒!应该这么写!create proc aa( @StartNo int,@EndNo  int ,@cc int,@bb int)
    as
    begin
      select b.Time 
      from student a ,teacher b 
      where a.str_StatNoIn=@StartNo
            and a.str_StatNoOut=@EndNo
    and b.StartNo=@cc and b.EndNo=@bb
    and @StartNo=@cc and @EndNo=@bb
    end
      

  4.   

    create proc aa( @StartNo int,@EndNo  int ,@cc int,@bb int)
    as
    begin
     exec(' select b.Time    --动态
      from student a ,teacher b 
      where a.str_StatNoIn=@StartNo
            and a.str_StatNoOut=@EndNo
    and b.StartNo=@cc and b.EndNo=@bb
    and '+@StartNo+'=@cc and +'@EndNo'=@bb ')  --引号自己调整吧  end
      

  5.   

    这句我就看不懂啦!
    '+@StartNo+'=@cc and +'@EndNo'=@bb '和我写的那句区别在哪里那!
    @StartNo=@cc and @EndNo=@bb