General information
Forum:
Microsoft SQL Server
Title:
Auto Incremental Value in Query
Hi!
I would like to know how to add an incremental value as a Column in a Query.
e.g.:
Table: Client.
Code Name Type
112533 John A
421326 Samuel B
721423 Peter A
443231 Steve A
551242 Erick C
632142 Mariah B
242312 Carlos B
select as IdNum,
Type,
count('x') as Counter
from Client
group by Type
Result:
IdNum Type Counter
1 A 3
2 B 3
3 C 1
Thanks in advance!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only