【发布时间】:2021-07-01 06:08:55
【问题描述】:
我将几个参数传递给 mysql 查询。其中一些可以是“全部”或“空”。我怎样才能使用一个查询呢?
如何传递,例如,action=ALL、user=3、what=ALL。 ALL 我的意思是所有可能的行动选项。
SELECT id, user, action, what, from_value, to_value, updated_date
from history
where (user=? and action=? and what=?)
order by updated_date DESC
【问题讨论】:
标签: mysql select multiple-conditions