我有以下select语句可以正常工作(使用SQL Server 2012):
SELECT distinct(Department) FROM Projects
但是当我尝试以下内容时:
SELECT 'January', distinct(Department) FROM Projects
我收到一条错误消息,说明我无法理解(
我也试过这个小组,但似乎没有工作:
SELECT 'January' mm, distinct(Department)
FROM Projects
GROUP BY mm
答案 0 :(得分:1)
试试这个:
SELECT DISTINCT department, 'January' mm FROM projects
一个注意事项:您应该使用大写SQL关键字。