问题
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