SELECT *
FROM TABLEA
WHERE (MMMMMM='?' OR TRIM('?') IS NULL)
? 为MMMMMM字段,客户端传过来的查询内容
含义 :
1.MMMMMM有值则执行
SELECT *
FROM TABLEA
WHERE MMMMMM='?'
2.MMMMMM无值则执行
SELECT *
FROM TABLEA
WHERE '?' is NULL
相当于 :
SELECT *
FROM TABLEA