FQL 中是否允许使用两个 WHERE 子句?

发布于 2024-12-25 20:23:55 字数 275 浏览 2 评论 0原文

我尝试在一个 fql 查询中使用两个 WHERE 子句,

SELECT uid, pic, pic_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND WHERE strstr('ab',name)

但出现错误

Parser error: unexpected 'WHERE' at position

I am trying to use two WHERE clauses in one fql query

SELECT uid, pic, pic_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND WHERE strstr('ab',name)

but getting error

Parser error: unexpected 'WHERE' at position

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

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

发布评论

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

评论(2

使用 AND 就足够了:

SELECT .... 
FROM ..... 
WHERE ((Condition A) AND (Condition B))

Its enough to use AND like:

SELECT .... 
FROM ..... 
WHERE ((Condition A) AND (Condition B))
庆幸我还是我 2025-01-01 20:23:55

右括号错误,或者您错过了完整的(第二个)子选择子句。

SELECT uid, pic, pic_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()    ====>>) AND ====>>WHERE strstr('ab',name)

Either the closing bracket is wrong, or you miss a complete (second) subselect clause.

SELECT uid, pic, pic_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()    ====>>) AND ====>>WHERE strstr('ab',name)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文