gpt4 book ai didi

mysql - 当变量为 NULL 时跳过 AND

转载 作者:行者123 更新时间:2023-11-29 01:54:36 24 4
gpt4 key购买 nike

我有一个现有的存储过程,我添加了一些参数来过滤结果。但是当@id_account 为 null 时,它返回空数据。我想跳过并且当@id_account 为空时,我尝试 IF 条件但它不会工作。有什么建议吗?谢谢:D



(
pd_account.id_account = @id_account
)

最佳答案

放入你真正想要的条件,即:

(pd_account.id_account = @id_account or @id_account is null)

关于mysql - 当变量为 NULL 时跳过 AND,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32659196/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com