select distinct substring(stu_class,1,4) grade 
from 
(select *
from stu_info a inner join selcou_info b 
on a.stu_id=b.stu_id 
where score_time='43242') ttwhere stu_class like @a 

解决方案 »

  1.   

    select distinct substring(stu_class,1,4) grade 
    from (select *
    from stu_info a inner join selcou_info b 
    on a.stu_id=b.stu_id 
    where score_time='43242') a
    where stu_class like @a 
      

  2.   

    多次为 'a' 指定了列 'stu_id'
      

  3.   

    select distinct substring(stu_class,1,4) grade 
    from 
    (select *
    from stu_info a inner join selcou_info b 
    on a.stu_id=b.stu_id 
    where score_time='43242') 
    where stu_class like @a
      

  4.   

    在关键字 'where' 附近有语法错误
      

  5.   

    select distinct substring(stu_class,1,4) grade 
    from 
    (select *
    from stu_info a inner join selcou_info b 
    on a.stu_id=b.stu_id 
    where score_time='43242') ttwhere stu_class like @a 这句不行吗
      

  6.   

    select distinct substring(a.stu_class,1,4) grade 
      from stu_info a 
           inner join selcou_info b on a.stu_id =b.stu_id
      where a.stu_class like @a and score_time ='43242'