gpt4 book ai didi

SQL 简单和替代?

转载 作者:行者123 更新时间:2023-12-04 21:47:26 24 4
gpt4 key购买 nike

这里是 SQL 的极端新手。有更简单的方法吗?

SELECT event_type, flow, userid
FROM checkpoints_esc
WHERE date='2013-05-14' AND event_type='flow_started' AND flow='1921474754'
OR flow='3326882819' OR flow='1916289507' OR flow='2121958995'
OR flow='2142167604'
LIMIT 1000;

希望 SQL 有类似这样的数组列表:

MyFlows = @[1921474754, 3326882819, 1916289507, 2121958995, 2142167604]
WHERE date='2013-05-14' AND event_type='flow_started' AND @MyFlows

最佳答案

您可以使用 IN 关键字:

SELECT event_type, flow, userid
FROM checkpoints_esc
WHERE date='2013-05-14' AND event_type='flow_started'
AND flow IN ('1921474754', '3326882819', '1916289507', '2121958995', '2142167604')
LIMIT 1000;

关于SQL 简单和替代?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16576980/

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