-
Notifications
You must be signed in to change notification settings - Fork 284
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
add TOP
clause support.
#821
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check expression
and modifier
to prevent SQL injection. Then this is good to go. Great job!
Changes since last review:
|
"singleQuote": true, | ||
"trailingComma": "all" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier started making 982136491826341298632189 changes removing commas everywhere.
Hey 👋
top
clause is supported in dialects such as MS SQL Server (MSSQL) and Snowflake.It works just like
limit
in other dialects, but has some interesting modifiers likepercent
.It's the easiest way to limit rows in a
select
query, given that MSSQL doesn't have alimit
clause. The alternative usesorder by offset <n> rows fetch next <n> rows only
which is less intuitive as it requires an extra step (order by ... offset
).It is also supported in
insert ... select
/update
/delete
/merge
queries.