【发布时间】:2018-08-14 15:45:06
【问题描述】:
我正在使用 Microsoft SQL Database Management Studio,它不允许我使用 strftime() 函数来运行查询。我必须按月创建一个表,每个月都有新用户和取消订阅者。
这就是我所拥有的导致错误的本质:
SELECT strftime('%m', createddate) AS 'Month', COUNT(createddate) AS 'Subscribers',
COUNT(dateunsubscribed) AS 'UNsubscribers'
FROM subscriber
GROUP BY 1
ORDER BY 1;
如果没有strftime(),我还能如何运行此查询,或者如何让strftime() 工作?
【问题讨论】:
-
那是因为
strftime()不是 SQL Server 函数。提示:改为查看formats
标签: sql select strftime database-management