Avatar of searchsanjaysharma
searchsanjaysharma asked on

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

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
Microsoft SQL Server 2008

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question


searchsanjaysharma, I am very pleased you have an answer
- but would ask why you have given it C as a grading?

Did I fail to explain something?
I try to make my responses as complete as I can, was it really so bad it deserved "C"?
(C is considered a "bad answer")

What grade should I award?
C should only be given for an incomplete solution that does not fully address or answer the question. A C grade should be awarded only after the asker has replied to all expert comments, provided all requested information, tried all suggested solutions, given the experts ample time to reply, and received clarification about the answer given. The asker must justify giving a C grade and give the experts an opportunity to improve it.
How can I improve on the answer?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy