question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline query support

See original GitHub issue

Hello, does ‘sequelize’ support inline query? I have met a problem that I have to select some data from inline view today. I have tried some methods which others offered, just like: use sequelize. literal in property of ‘attributes’, but it doesn’t work and results in just like below:

select (select * from dbname) from ...

Execpt sequelize.query, can i find other methods to do select like this:

SELECT 'hid', count('max') FROM (SELECT 'hid', max('version') AS max, 'uid' FROM db WHERE db.hid = 'xxx' AND db.time <= '245527422' GROUP BY db.uid);

Thanks a lot.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
felixfbeckercommented, Sep 8, 2016

Alternative:

QueryInterface.select(sequelize.inlineQuery({
  attributes: ['hid']
  from: 'db',
  where: {
    hid: 'xxx',
    time: '245527422'
  },
  groupBy: 'uid'
}), {
  attributes: ['hid', sequelize.fn('COUNT', 'max')]
})
0reactions
stale[bot]commented, Jun 29, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's an SQL Inline Query? - LearnSQL.com
An inline view is a query in the FROM clause of another query. How I learnt, this makes it the same as a...
Read more >
Query Building Support From Inline Data Systems - Inline CRM
Query Building Support. Inline Data Systems delivers a flexible system that uses ad hoc query building to build data sets from scratch.
Read more >
Inline queries - semantic-mediawiki.org
Standard parameters for inline queries[edit]. In general, an inline query is a request to find a number of pages that satisfy certain ...
Read more >
Inline Subqueries | SQL Tutorial Documentation on data.world
In a standard inline subquery, the subquery is a component of a FROM clause, ... i.e., not referencing any fields from the containing...
Read more >
Inline Queries | grammY
With inline queries, users can search for, browse, and send content ... grammY has special support for handling inline queries via the bot....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found