0

I have the following select statement which works fine (using SQL Server 2012) :

SELECT distinct(Department) FROM Projects

But when I try the following:

SELECT 'January', distinct(Department) FROM Projects

I get an error message that I could not understand what was next to (

I tried the group by as well but did not seem to work:

SELECT 'January' mm, distinct(Department)
FROM Projects
GROUP BY mm 
1
  • But what are you trying to do? What is your expected output? Commented Dec 8, 2013 at 3:03

1 Answer 1

1

Try this:

SELECT DISTINCT department, 'January' mm FROM projects

One note: You should uppercase SQL keywords.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes; DISTINCT is not a function, so no parentheses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.