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) )) | |
![]() | ![]() |