日期:2014-05-18  浏览次数:20464 次

关于一段错误的SQL语句(帮顶有分)
各位高手帮忙看看这段程序,急,谢谢~~~~
===========================================================================
Create     Proc   MoreConditionSlect   @Habitation   varchar(100),@Sex   char(1),@Eduction   varchar(10),
              @WorkTime   varchar(20),@NowJobtype   varchar(50),
                                                                    @NowJobName   varchar(50),@ISManage   char(1),
              @Area   varchar(30),@Trade   varchar     (50),@RefurbishTime   DateTime,
              @Language   varchar(20),@LS   varchar(10),@StartTime   DateTime,@EndTime   DateTime,@Company   varchar(50)
AS
select   UB_UserName,UB_Tname,UB_Brithday,UB_Habitation,UB_SEX,UB_Eduction,UB_WorkTime,UJ_NowJobtype,UEI_Company,UJ_Nowtrade,UJ_NowJobName,UJ_ISManage,UJ_Area,UJ_Trade,UR_RefurbishTime,ULI_Language,ULI_LS   from   (select   a.*,b.*,c.*,d.*,e.*   from   dbo.U_Base_Info   as   a,   dbo.U_Job_Intent   as   b,dbo.U_Resume_Manage   as   c,dbo.U_Lang_Info   as   d,dbo.U_Experience_Info   as   e   where   a.UB_UserName   =   b.UJ_UserName   and   b.UJ_UserName   =   c.UR_BelongUser   and   c.UR_BelongUser   =   d.ULI_UserName   and   d.ULI_UserName   =   e.UEI_UserName   and   e.UEI_Btime   in   (select   max(UEI_Btime)   from   dbo.U_Experience_Info   group   by   dbo.U_Experience_Info.UEI_UserName   )   )   as   Exp1        
where   (   UB_Habitation   like   '% '+@Habitation+ '% '   or   @Habitation   =   ' '   )   and
            (   UB_SEX   like   '% '+@Sex+ '% '   or   @Sex   =   ' '   )   and
            (   UB_Eduction   like   '% '+@Eduction+ '% '   or   @Eduction   =   ' '   )   and
            (   UB_WorkTime   like   '% '+@WorkTime+ '% '   or   @WorkTime   =   ' '   )   and  
            (   UJ_NowJobtype   like   '% '+@NowJobtype+ '% '   or   @NowJobtype   =   ' '   )   and
            (   UJ_NowJobName   like   '% '+@NowJobName+ '% '   or   @NowJobName   =   ' '   )   and
            (   UJ_ISManage   like   '% '+@ISManage+ '% '   or   @ISManage   =   ' '   )   and
            (   (set   @Language   =   replace(@Language, ', ', '% ')                                
set   @Language   =   '% '   +   @Language   +   '% ')
            &nb