We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Input data
Which SQL and options did you provide as input? Language = Snowflake All other options default
select "ID", "Pay" / 100 AS "Pay", "Status", "OpTtl" / 100 AS "OpTtl", "TestAmt" / 100 AS "TestAmt", CONVERT_TIMEZONE('UTC', $Timezone, "WrittenAt"::TIMESTAMP_NTZ) AS "LocalWrittenDt", CONVERT_TIMEZONE('UTC', $Timezone, "CompleteAt"::TIMESTAMP_NTZ) AS "LocalCompleteDt", CONVERT_TIMEZONE('UTC', $Timezone, "UpdatedAt"::TIMESTAMP_NTZ) AS "LocalUpdatedDt", CONVERT_TIMEZONE('UTC', $Timezone, "MessageTime"::TIMESTAMP_NTZ) as "ESTMessageTime", "ExternalAccountId" as "CustomerAccountId", "AffiliateId", "SourceSystemId", "DomainId", "RetailTicketId", "Test" from "StagingMARA"."Contract" where "ESTMessageTime" < $Todate Qualify dense_rank() over ( partition by "ID" order by "ESTMessageTime" desc ) = 1
Expected Output
select "ID", "Pay" / 100 AS "Pay", "Status", "OpTtl" / 100 AS "OpTtl", "TestAmt" / 100 AS "TestAmt", CONVERT_TIMEZONE('UTC', $Timezone, "WrittenAt"::TIMESTAMP_NTZ) AS "LocalWrittenDt", CONVERT_TIMEZONE('UTC', $Timezone, "CompleteAt"::TIMESTAMP_NTZ) AS "LocalCompleteDt", CONVERT_TIMEZONE('UTC', $Timezone, "UpdatedAt"::TIMESTAMP_NTZ) AS "LocalUpdatedDt", CONVERT_TIMEZONE('UTC', $Timezone, "MessageTime"::TIMESTAMP_NTZ) as "ESTMessageTime", "ExternalAccountId" as "CustomerAccountId", "AffiliateId", "SourceSystemId", "DomainId", "RetailTicketId", "Test" from "StagingMARA"."Contract" where "ESTMessageTime" < $Todate qualify dense_rank() over ( partition by "ID" order by "ESTMessageTime" desc ) = 1
Actual Output
Usage
How are you calling / using the library? I am using this through Chrome - https://sql-formatter-org.github.io/sql-formatter/.
What SQL language(s) does this apply to? Snowflake is all I have tried.
Which SQL Formatter version are you using? v12.0.3
Including a link to the Snowflake documentation for Query Syntax and QUALIFY documentation. https://docs.snowflake.com/en/sql-reference/constructs.html
https://docs.snowflake.com/en/sql-reference/constructs/qualify.html
The text was updated successfully, but these errors were encountered:
Thanks for reporting.
This should be a simple fix to make.
Sorry, something went wrong.
Support QUALIFY clause in Snowflake
7f46aa5
Fixes #539
This is now fixed in 12.0.4 release.
Thanks. Works great!
Successfully merging a pull request may close this issue.
Input data
Which SQL and options did you provide as input?
Language = Snowflake
All other options default
Expected Output
Actual Output
Usage
How are you calling / using the library?
I am using this through Chrome - https://sql-formatter-org.github.io/sql-formatter/.
What SQL language(s) does this apply to?
Snowflake is all I have tried.
Which SQL Formatter version are you using?
v12.0.3
Including a link to the Snowflake documentation for Query Syntax and QUALIFY documentation.
https://docs.snowflake.com/en/sql-reference/constructs.html
https://docs.snowflake.com/en/sql-reference/constructs/qualify.html
The text was updated successfully, but these errors were encountered: