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
Data-uid.xlsx
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
PortletPaul
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of searchsanjaysharma
searchsanjaysharma

ASKER

tx
Avatar of PortletPaul
PortletPaul
Flag of Australia image

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

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo