SELECT AAA,BBB,CCC,DDD FROM TABLEM m,TABLEG g
WHERE (CASE WHEN @参数 IS NOT NULL THEN m.AAA = @ClientCode ELSE 1=1 END) ------解决方案-------------------- 参数是textbox ---> allow nulls
dropdownlist ---> select 'None' union all select ................. 代替null ------解决方案-------------------- 你查询为全部