'How to select distinct on "name" using Sequelize?
I need to translate the postgresql query below
select distinct on (name) * from users
To seqelize query / condition .
Currently I am just selecting all users from user table by
select * from user where owner_id='123 (some dynamic id)'
equalent to
const total = await findAllEmojams({
where: {
owner_id: owner_id ( a dynamic owner id )
});
Sample table :
id name owner_id
1 name 1 133
2 name 2 145
3 name 3 167
4 name 1 677
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
