查询时间过长ERROR [英] Query too long ERROR

查看:75
本文介绍了查询时间过长ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询是

My Query is

Select * from Order_Table where OrderNo 
in(1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,
...
Many, many similar rows deleted to make this less of a PITA to load...
...
21063,21065,21066,21067,21069,21070,21071,21072,21073,21074,21075,21076,21077,21078,21079,21080,21081,21082,21083,21084,21085,21086,21087,21088,21089,21090,21091,21092)





它给我的错误如查询太长我必须删除记录,除了这个没有我得做。请帮助我....数据库MS ACcess 2002-2003





删除HUGE查询中的行 - 是20,000多个ID - OriginalGriff [/ edit]



it gives me error like "Query is too long" i have to delete record except this no what i have to do. please help me.... Database MS ACcess 2002-2003


[edit]Rows in HUGE query removed - was 20,000+ IDs - OriginalGriff[/edit]

推荐答案

113875个字符。



这是你的查询的时长。

帮助文件 http:// office .microsoft.com / zh-CN / access-help / access-2010-specifications-HA010341462.aspx [ ^ ]表示最大查询长度为大约64,000个字符,因此您将超过此值的两倍。



这是一个非常愚蠢的查询!我不知道为什么你认为这是一个好主意,但看看你的设计,因为必须有一个比这更好的方法!
113875 characters.

That is how long your query is.
The help file http://office.microsoft.com/en-us/access-help/access-2010-specifications-HA010341462.aspx[^] says that the maximum query length is "Approximately 64,000 characters" so you are exceeding this by a factor of two.

That is a spectacularly silly query! I have no idea why you think this is a good idea, but have a look at your design, because there has to be a better way than this!


首先阅读所有评论到OriginalGriff回答。



正如会员2707515所提到的,你可以使用另一张表存储价值以供将来使用。

First of all read all comments to OriginalGriff answer.

As Member 2707515 had mentioned, you can use another table to store values to future use.
SELECT t1.*
FROM Table1 AS t1 RIGHT JOIN Table2 AS t2 ON t1.OrderNo = t2.OrderNo





另一个方法是在...和... 语句之间使用,但如果 OrderNo 是连续方式会有用。



Another way is to use between ... and ... statement, but it would be helpful if OrderNo is continuos way.

SELECT *
FROM Table1
WHERE OrderNo BETWEEN 1 AND 21092


这篇关于查询时间过长ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆