How implement this query
See original GitHub issueSELECT "a".* FROM "accounts" a, account_phones p, account_emails e, WHERE
(p.phone ilike '%11111111111%' OR e.email ilike '%11111111111%')
AND a.id = p.account_id
AND a.id = e.account_id
ORDER BY "id" DESC;
I do
db.Accounts.findAll({
where: where,
include: [
{model: db.AccountEmail, where: whereEmail, required: false },
{model: db.AccountPhone, where: wherePhone, required: false }
]
})
and it no worked
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
What are the Best Ways to Write a SQL Query? - GeeksforGeeks
1. Provide Correct Formatting for the Query · Put each statement in the query in a new line. · Put SQL keywords in...
Read more >An Introductory SQL Tutorial: How to Write Simple Queries
Learn how to get started with this beginner's guide to writing simple SQL queries.
Read more >How to Create a SQL Statement - UCSD Blink
1. Start your query with the select statement. · 2. Add field names you want to display. · 3. Add your statement clause(s)...
Read more >Learn to write basic SQL Queries - SQLShack
The goal of this article is to gain the ability to write basic SQL queries for the beginners.
Read more >Implementing Query-by-Example - 4Js
This program implements query-by-example, using the CONSTRUCT statement to allow the user to enter search criteria in a form. The criteria is used...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try something like