当我在Manticore中使用GROUP BY语法时,有重复的分组ID的结果。我们刚刚从狮身人面像2.X迁移到最新的Manticore,在狮身人面像中没有这个具有相同查询的序幕。
这是狮身人面像QL查询:
SELECT model_id, model_root, model_name FROM search WHERE model_id != 0 GROUP BY model_root WITHIN GROUP ORDER BY model_level ASC ORDER BY model_level ASC, model_occurrence DESC, model_name ASC LIMIT 0, 13
因此,将model_root分组,并且在->10,11(Cannon)处有一个重复的键->这不是我所期望的。
结果如下:
array:13 [▼
0 => array:3 [▼
"model_id" => "62763"
"model_root" => "62763"
"model_name" => "HP"
]
1 => array:3 [▼
"model_id" => "72771"
"model_root" => "72771"
"model_name" => "Sony"
]
2 => array:3 [▼
"model_id" => "72524"
"model_root" => "72524"
"model_name" => "Compaq"
]
3 => array:3 [▼
"model_id" => "62783"
"model_root" => "62783"
"model_name" => "Samsung"
]
4 => array:3 [▼
"model_id" => "62760"
"model_root" => "62760"
"model_name" => "Asus"
]
5 => array:3 [▼
"model_id" => "62761"
"model_root" => "62761"
"model_name" => "Toshiba"
]
6 => array:3 [▼
"model_id" => "85086"
"model_root" => "85086"
"model_name" => "Panasonic"
]
7 => array:3 [▼
"model_id" => "151763"
"model_root" => "151763"
"model_name" => "Acer"
]
8 => array:3 [▼
"model_id" => "72548"
"model_root" => "72548"
"model_name" => "Packard Bell"
]
9 => array:3 [▼
"model_id" => "62762"
"model_root" => "62762"
"model_name" => "Lenovo"
]
10 => array:3 [▼
"model_id" => "83072"
"model_root" => "83072"
"model_name" => "Canon"
]
11 => array:3 [▼
"model_id" => "83072"
"model_root" => "83072"
"model_name" => "Canon"
]
12 => array:3 [▼
"model_id" => "73476"
"model_root" => "73476"
"model_name" => "LG"
]
]
预期:
array:13 [▼
0 => array:3 [▼
"model_id" => "62763"
"model_root" => "62763"
"model_name" => "HP"
]
1 => array:3 [▼
"model_id" => "72771"
"model_root" => "72771"
"model_name" => "Sony"
]
任何想法 查询或索引定义有什么问题?
肥皂起泡泡