WITH DailyLogins AS (
SELECT
Username,
LicenseType,
CAST(LoginTime AS DATE) AS LoginDate
FROM your_table_name
WHERE LoginTime >= DATEADD(month, -3, GETDATE()) -- Filter for last 3 months
),
MonthlyLoginCounts AS (
SELECT
Username,
LicenseType,
COUNT(DISTINCT LoginDate) AS MonthlyLoginCount
FROM DailyLogins
GROUP BY Username, LicenseType
)
SELECT
Username,
LicenseType,
MonthlyLoginCount
FROM MonthlyLoginCounts
ORDER BY MonthlyLoginCount DESC;
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-05-03 UTC。"],[],[]]