DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,864 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
quanjongliang
quanjongliang

Posted on

Sequelize query * with count by field

Hi everyone

Can you help to rewrite this raw query by sequelize? Thanks

`select * ,
(select COUNT(*)
from outreachcontacts
where primaryContact = table_alisa.primaryContact
) as count

from outreachcontacts as table_alisa `

Top comments (0)

DEV has this feature:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›