Foxpro SQL 查询> 24 标准
我正在使用 OleDB 连接到 FoxPro DBF 数据库。我需要查询表中列 = key1 或 key2 或 key3...... key2000 的所有项目。
FoxPro 显然不喜欢长查询......
我已经尝试过:
where (col like "key1") or (col like "key2") or ..... (col like "key2000")
并且
where col in ("key1", "key2", "key3", "key4".... "key2000")
第一个解决方案因“查询太复杂”而失败。第二个键因范围内元素过多而失败(显然最大值为 24)。这看起来很荒谬......
有没有办法让我在不进行多次读取的情况下构建查询?
谢谢。
I'm using OleDB to connect to a FoxPro DBF database. I need to query a table for all items with column = key1 or key2 or key3...... key2000.
FoxPro apparently doesn't like long queries....
I've tried both:
where (col like "key1") or (col like "key2") or ..... (col like "key2000")
and
where col in ("key1", "key2", "key3", "key4".... "key2000")
The first solution fails for "query too complex". The second key fails for too many elements in the in range (apparently the max is 24). This seems absurd...
Is there a way for me to construct my query without multiple reads?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将您的条件推入临时表或条件表并从中查询
You need to push your criteria into a temporary table or criteria table and query from that
两种可能性:
1) 使用多个 IN 子句,每个子句包含 24 个值
2) 将 2000 个值放入逗号分隔的字符串中并使用
Two possibilities:
1) Use multiple IN clauses with 24 values in each
2) Put the 2000 values in a comma-delimited string and use