Skip to content

Is there a way to order by where in field? #4730

@giiska

Description

@giiska

The sql is like this:

SELECT
    `id`,
    `name`
FROM
    `members` AS `member`
WHERE
    `member`.`id` IN('40', '44', '41', '42', '43', '45')
ORDER BY FIELD(`member`.`id`,'40', '44', '41', '42', '43', '45')

How to get this done by Sequelize ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions