Last active
April 28, 2023 11:04
-
-
Save viggin543/7c07ea7195b2ad1742c8ee645181e93c to your computer and use it in GitHub Desktop.
snowsql cloud credits per querry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
LEFT(query_text,300),USER_NAME, COUNT(LEFT(query_text,300)) as COUNT_QUERIES, SUM(CREDITS_USED_CLOUD_SERVICES) | |
from SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY as jb | |
where start_time between '2023-04-27' and '2023-04-28' | |
GROUP BY LEFT(query_text,300), USER_NAME | |
order by 3 desc nulls last LIMIT 100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment