0
Hallo我有一個問題,在nodejs中用ORM(node-orm2)和databse postgresql選擇groupBy。groupby with org nodejs on postgresql
代碼:
req.models.roomcategorylog.find(["id", "Z"],
function(err, results) {
if (err) {
res.json({
status: false,
message: 'Error found',
data:err
});
} else {
res.json({
status:true,
message: 'Data found',
data:results
});
// console.log(results);
}
});
這段代碼有導致這樣的:
id , users_id , username
37 1 faris
36 1 faris
35 1 faris
34 2 ridho
33 3 kotaro
,但我想我需要在我SISTEM什麼1 「users_id」 像組通過與結果查詢:
id , users_id , username
37 1 faris
34 2 ridho
33 3 kotaro
感謝您的關注和解決:)
我該如何獲得聚合?在我的結果中說「無效的錯誤代碼:缺少聚合函數」。 thx之前 –