-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sub-query in where conditions #3961
Comments
I would be very interested by the answer, as I did not find a solution. |
A sub query can be done like this... characteristic_id : {
$in: [clout.sequelize.literal('select characteristic_id from characteristic_variant_val'))]
} |
I've got three models to represent any supported I want to have a pending translations query that could be represented with,
or
Theese two queries work perfectly on PostgreSQL but don't preserve cross-database modeling. How could I represent the pending translations (messages and their language that actually haven't yet a translation instance) using Sequelize data models? I thought a Sequelize scope could serve for this pourpose but it actually represents a query applied on real instances. |
I have encountered a similar issue in my project. The way I choose to implement it is a bit different for two reasons:
Some people might choose to not use the tempSQL variable and simply build the SQL inside the find structure (maybe using a helper method?) I also think this might be the basis for a sub queries extension for sequelize as it uses the same syntax almost. |
Hi!
Is it possible to specify sub-query for where?
For example I need a final query be:
I tried to do:
How can I properly specify sub-request? How can I properly specify params?
The text was updated successfully, but these errors were encountered: