April 10, 2012 at 7:17 am
Here is the query I am using. However the ID is always 1.
How do I bring back a different ID for each row?
select @@rowcount ID, EquipmentClass,EquipmentMake,EquipmentYear
from prdappall
group by EquipmentClass,EquipmentMake,EquipmentYear
April 10, 2012 at 7:17 am
Look up the ROW_NUMBER function.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 10, 2012 at 10:49 pm
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply