goback add

sql多条件查询

3297 点击·0 回帖
灯火互联
楼主
sql多条件查询
 
SELECT * FROM ET_TrainingFile  where
( @fileName is null or len(@fileName)=0 or FileName like  '%'+@fileName+'%' )
and
( @type is null or len(@type)=0 or type =@type )
and
( @Country is null or len(@Country)=0 or Country =@Country )
 
and ( @directoryId is null or len(@directoryId)=0 or directoryid=@directoryId or directoryId in( select Id from c_tree(@directoryId)  ))

喜欢0 评分0