gpt4 book ai didi

sql - SQLite不为空

转载 作者:行者123 更新时间:2023-12-03 18:36:19 26 4
gpt4 key购买 nike

如果任何(stage1_choice,stage2_choice或stage3_choice)值= null,如何将其排除在行之外?



我试过了:

SELECT  r.breakout_id ,
r.case_id ,
r.stage_id ,
r.chart_id ,
s.stage1_choice ,
s.stage2_choice ,
s.stage3_choice
FROM Results AS r ,
Submissions AS s
WHERE r.breakout_id = '1'
AND s.breakout_id = '1'
AND r.case_id = s.case_id
AND stage_id < 4
AND s.stage1_choice NOT NULL
AND s.stage2_choice NOT NULL
AND s.stage3_choice NOT NULL


但是它仍然返回在其中一列中包含null的行。

最佳答案

尝试

SELECT r.breakout_id, r.case_id, r.stage_id, r.chart_id, s.stage1_choice, s.stage2_choice, s.stage3_choice
FROM Results as r, Submissions as s
WHERE r.breakout_id = '1' AND s.breakout_id = '1' AND r.case_id = s.case_id AND stage_id < 4 AND s.stage1_choice NOT NULL AND s.stage2_choice IS NOT NULL AND s.stage3_choice IS NOT NULL


要么

SELECT r.breakout_id, r.case_id, r.stage_id, r.chart_id, s.stage1_choice,   s.stage2_choice, s.stage3_choice
FROM Results as r, Submissions as s
WHERE r.breakout_id = '1' AND s.breakout_id = '1' AND r.case_id = s.case_id AND stage_id < 4 AND s.stage1_choice != '' AND s.stage2_choice != '' AND s.stage3_choice != ''

关于sql - SQLite不为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22199823/

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