gpt4 book ai didi

mysql - 如何在一条sql语句中使用and or选择mysql

转载 作者:行者123 更新时间:2023-11-29 10:58:44 25 4
gpt4 key购买 nike

我想从我的表中选择所有记录,其中referal = 0 和 1 且 pos_left=NULL OR pos_right=NULL

谁能帮我提供sql吗? Table Record

最佳答案

SELECT * from your_table 
WHERE referral IN (0,1)
AND ( ( pos_left IS NULL ) OR ( pos_right IS NULL ) )

逻辑表达式的问题:字段引用不能 = 0 和 1,就像人类总是男人或女人,不能是男人和女人;-)

关于mysql - 如何在一条sql语句中使用and or选择mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42606066/

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