FQL Multiquery Returned Info

白昼怎懂夜的黑 提交于 2019-12-11 09:05:58

问题


I'm trying to use an FQL Multiquery to obtain my most recent Facebook question and options with one query using an http request.

So far the query I tried to use is:

SELECT name, votes FROM question_option WHERE question_id IN 
   (SELECT id, question FROM question WHERE owner = me() 
   ORDER BY created_time DESC LIMIT 1)

Unfortunately this only returns the name and votes from the outer query and not the question text from the inner one. Is there a way to retrieve all 3 without making 2 queries?


回答1:


What you posted isn't a multiquery. A proper multiquery should get you what you want:

{
'question_detail':
  'SELECT id, question FROM question WHERE owner = me() 
     ORDER BY created_time DESC LIMIT 1',
'question_answers':
   'SELECT name, votes FROM question_option WHERE question_id IN
      (SELECT id FROM #question_detail)'
 }

You'll need to get rid of the whitespace for this to properly execute.



来源:https://stackoverflow.com/questions/14389046/fql-multiquery-returned-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!