I'm finding the snowflake documentation very challenging to follow and derive solutions.
I want to select a list of users from snowflake. I only need one column (any account login that matches an email address), and I need to put this into JSON format.
I do not want to select any other field except for 'name' (which in our case is an email address).
This should be easy, and maybe it is, but I cannot find any documentation that would lead to a solution.
When I do a search on selecting users, I am taken to this page
https://docs.snowflake.com/en/sql-reference/sql/show-users.html <== no examples
the command is 'show users;'
The problem with this is that:
Ideally I would like to do is to select from a view.
With a search, I am led to a 'users view', but I see no examples on that page on how to select from it, and everything I try fails.
https://docs.snowflake.com/en/sql-reference/account-usage/users.html <== how do I select from this view?
I want to select from a view where the login contains '@' and then put into JSON format.
I need JSON output that looks like the following:
{
"users": [
{"user": '<email_address>'},
{"user": '<email_address>'},
{"user": '<email_address>'},
...
]
}
Is it even possible to accomplish this?
Any help would be greatly appreciated.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.