Teste os modelos do Gemini 1.5, os modelos multimodais mais recentes na Vertex AI, e veja o que é possível criar com uma janela de contexto de até 2 milhões de tokens.
Teste os modelos do Gemini 1.5, os modelos multimodais mais recentes na Vertex AI, e veja o que é possível criar com uma janela de contexto de até 2 milhões de tokens.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Gerar uma consulta SQL para contar e classificar logins únicos no último mês
É possível consultar um modelo diretamente e testar os resultados retornados ao usar
diferentes valores de parâmetros com o console do Cloud ou ao chamar a
API Vertex AI diretamente.
"Consider a table with schema as described below.
' Column name - Description
' Username - username of the user logging in
' LicenseType - Either ""MultiUse"" or ""SingleUse""
' LoginTime - The datetime of the login event
As data analysis expert, please write a SQL query to show me the list of
users, their license types and the number of unique days on which the user
logged in for the last 3 calendar months. Sort it by highest count of logins
in a month to the lowest count of logins in a month."
Resposta
```sql
WITH MonthlyLogins AS (
SELECT
Username,
LicenseType,
DATE(LoginTime) AS LoginDate
FROM
YourTable
WHERE
LoginTime BETWEEN DATE('now', '-3 months') AND DATE('now')
),
UniqueLoginDays AS (
SELECT
Username,
LicenseType,
COUNT(DISTINCT LoginDate) AS UniqueLoginDays
FROM
MonthlyLogins
GROUP BY
Username,
LicenseType
)
SELECT
Username,
LicenseType,
UniqueLoginDays
FROM
UniqueLoginDays
ORDER BY
UniqueLoginDays DESC;
```