传入多个查询参数时,某些情况下,只使用到其中一个或两个,这种情况下怎么动态的拼接出sql
1条回答 默认 最新
threenewbee 2023-04-12 22:18关注and的拼接
select * from table where 1=1
每次拼接 and xxx=xxx
or拼接
(select * from table where xxx=xxx) union (select * from table where yyy=yyy) ...解决 无用评论 打赏 举报
and的拼接
select * from table where 1=1
每次拼接 and xxx=xxx
or拼接
(select * from table where xxx=xxx) union (select * from table where yyy=yyy) ...