Add add number

J

JA

I have a group query:

SELECT Course.course_code, Course.course_name, Count
(Course.ID) AS CountOfID
FROM Course
GROUP BY Course.course_code, Course.course_name;

Is there any way I can add a numbering field (using the
build wizard or any way)to give numbering to records.

Please advise.
 
P

Patrick Molloy

you already have a numbering field...
Course.ID

change you SQL to
SELECT Course.ID, course_code, course_name, _
Count(Course.ID) AS CountOfID
FROM Course
GROUP BY course_code, course_name;

Patrick Molloy
Microsoft Excel MVP
 
D

Dianne

If Course.ID isn't satisfactory as a numbering field, you could try
something like this:

SELECT
C1.course_code,
C1.course_name,
( SELECT count(*) FROM Course C2 WHERE C2.Course_code <=
C1.Course_code ) as Counting
FROM Course C1 ;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top