troubleshooting Question

How to generate id with increment order on change of every course

Avatar of searchsanjaysharma
searchsanjaysharma asked on
Microsoft SQL Server 2008
3 Comments1 Solution236 ViewsLast Modified:
I have the following table custuds with following structure
create table custuds(course varchar(200),sname varchar(200),fname varchar(200),
mname varchar(200),id bigint)

The sample data is attached.

The table is sorted on the basis of course, sname.
The id should be generated in such a way that at change of every course, the id should begin from 1
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros