|
-
Feb 20th, 2009, 11:49 AM
#1
Thread Starter
Lively Member
[RESOLVED] Simple SQL Count Question
I am using SQL Server 2005 but for this question I know that is not a big deal.
This query gets me my desired results:
SELECT DISTINCT SerialNum, CommentNum
FROM CSSComments WHERE BatchID = 'Test'
It returns four records which is correct.
I just need a count showing that I have 4 records.
I am trying this but I get a syntax error:
SELECT Count(*) as Count FROM
(SELECT DISTINCT SerialNum, CommentNum
FROM CSSComments WHERE BatchID = 'Test')
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ')'.
How do I get a return value of 4.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|