join 되는 기준으로 order by / group by
const table_a = await models.TABLE_A.findAll({
include: [
{
as: "table_b",
model: models.TABLE_B,
required: true,
},
],
order: [[ {model: models.TABLE_B, as: "table_b" }, "id", "DESC"]],
group: [[ {model: models.TABLE_B, as: "table_b" }, "no"]]
});
'개발이야기 > Etc' 카테고리의 다른 글
node 특정 버전 설치 (0) | 2023.09.27 |
---|---|
vscode 빈 줄(라인) 삭제 (0) | 2023.05.10 |
CORS 에러: The request client is not a secure context and the resource is in more-private address space `local` (0) | 2022.08.14 |
bitbucket - Bitbucket Cloud recently stopped supporting account passwords for Git authentication 오류 (0) | 2022.03.10 |
브라우저에서 번역 하기 안먹히게 하는법 (0) | 2022.02.11 |