I get an error when running this query with Sequelize.query:
sequelize.query(
"SELECT hubs.* FROM hubs LEFT JOIN posts ON hubs.id = posts.hubId WHERE
posts.userId = ? GROUP BY hubs.id ORDER BY COUNT(posts.id)
DESC LIMIT 3",
{
replacements: [userId],
type: QueryTypes.SELECT
}
)
When i run it I get an error saying:
error: column posts.hubid does not exist
hint: 'Perhaps you meant to reference the column "posts.hubId"
As you can se in my query i have written posts.hubId and not posts.hubid as the error says. The hint is exactly how i have writeen my query. It seems to me like the query i wrote is not case-sensitive or what is the problem here?