我有这个查询,根据那里的{
"suites": 3,"tests": 3,"pending": 1,"root": {
"title": "(root)","suites": [
{
"title": "foo","suites": [
{
"title": "bar","suites": [],"tests": [
{
"title": "should do something","pending": false
}
]
},{
"title": "baz","tests": [
{
"title": "should do something else","pending": true
},{
"title": "should do another thing","pending": false
}
]
}
],"tests": []
}
],"tests": []
}
}
计算publication
在一组出版物(这里称为community
)中的位置:
effective_publishing_date
结果为:
[![在此处输入图片描述] [1]] [1]
现在我有一个SELECT p.publication_id,p.name publication_name,IF(p.scheduled_at is not null,p.scheduled_at,p.created_at) effective_publishing_date,@current_rank := @current_rank + 1 publication_rank
FROM publications p
JOIN (SELECT @current_rank := 0) r
WHERE p.community_id = 8513
ORDER
BY effective_publishing_date ASC;
的列表,它们分别具有feed_item
和community_id
作为属性,我想为每个publication_id
获取关联的{{1 }}。
例如,如果我有一个feed_item
= 18且publication_rank
= 2的publication_item
,我希望publication_id
#18中的community_id
publication_rank
#2的所有出版物。我无法一次查询(或通过子查询等)获得该信息。
感谢前进,