Facebook - “IN”中的最大参数数量;条款?

发布于 2024-08-22 19:15:29 字数 252 浏览 8 评论 0原文

Facebook 查询语言(FQL) 中,您可以指定 IN 子句,例如:

SELECT uid1, uid2 FROM friend WHERE uid1 IN (1000, 1001, 1002)

有谁知道您可以传递给 IN 的参数的最大数量是多少代码>?

In Facebook query language(FQL), you can specify an IN clause, like:

SELECT uid1, uid2 FROM friend WHERE uid1 IN (1000, 1001, 1002)

Does anyone know what's the maximum number of parameters you can pass into IN?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

朦胧时间 2024-08-29 19:15:29

我认为最大结果集大小是 5000

I think the maximum result set size is 5000

べ繥欢鉨o。 2024-08-29 19:15:29

它可能看起来像一个奇数(所以也许我错过了计数,但它接近〜1),但我似乎无法查询超过 73 个 IN 项目。这是我的查询:

SELECT object_id, metric, value
FROM insights
WHERE object_id IN ( ~73 PAGE IDS HERE~ )
AND metric='page_fans'
AND end_time=end_time_date('2011-06-04')
AND period=period('lifetime')

这是使用 JavaSCript FB.api() 调用。

It may seem like an odd number (so perhaps I miss counted, but it's close ~1), but I can not seem to query more than 73 IN items. This is my query:

SELECT object_id, metric, value
FROM insights
WHERE object_id IN ( ~73 PAGE IDS HERE~ )
AND metric='page_fans'
AND end_time=end_time_date('2011-06-04')
AND period=period('lifetime')

This is using the JavaSCript FB.api() call.

未央 2024-08-29 19:15:29

不确定是否存在未记录的限制,或者可能是 facebook fql 服务器超时的问题。

您应该检查 FB Web 服务器是否返回错误 500,这可能表明您传递的 GET 语句太长(请参阅 Facebook 查询语言 - 长查询

我意识到我的 get 太长了,所以我没有在 IN 语句中放入许多数字,而是在那里放置了一个子查询,从 FB FQL 中获取这些数字 - 但是不幸的是,FB 似乎无法处理该查询,并在 JSON 中返回了“未知错误”,这确实无助于我们理解问题。

Not sure if there is an undocumented limit or it might be an issue of facebook fql server timeout.

You should check if there is a error 500 returned from FB web server which might indicate you are passing a too long GET statement (see Facebook query language - long query)

I realized my get was too long so instead of putting many numbers in the IN statement, i put a sub-query there that fetches those numbers from FB FQL - but unfortunately it looks like FB couldn't handle the query and returned an 'unknown error' in the JSON which really doesn't help us understand the problem.

固执像三岁 2024-08-29 19:15:29

据我所知,不应该有最大参数数量,因为 SQL IN 中没有。
http://www.sql-tutorial.net/SQL-IN.asp

只是不要使用比要检查的函数值更多的参数,因为您不会得到任何结果(不知道它是否会给出错误,因为我从未尝试过)。

There shoud not be a maximum number of parameters as there isnt in SQL IN as far as I know.
http://www.sql-tutorial.net/SQL-IN.asp

just dont use more parameters than you have values for the function to check because you will not get any results (dont know if it will give away an error as I never tried to).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文