By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 2,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

SQL Counting number of rows

P: n/a
Hi, I have a table that for ease has this data in:

R1, R2, R....z
A | 12
A | 22
A | 30
B | 0
B | -1
B | -3
C | 100
I want to generate a table for each distinct row in R1, gives a count
of all the rows with data corresponding

For the above table I would get

A | 3
B | 3
C | 1

Im probably being stupid but cannot see this at the moment... please


May 3 '06 #1
Share this Question
Share on Google+
3 Replies

P: n/a
umm... how about doing a summary query. I'll give ya a hint. There's
this really neat feature in Access. It's called the Help file. It's
neatly hidden in the upper right hand corner of the menubar. Try
reading it.

May 3 '06 #2

P: n/a
Sounds like a great hint, but I dont have access. Im using a program
that takes direct SQL questions on its interface, which uses an access
datafile behind the scenes.

Though I may try microsoft and see if they have an online manual.
(Fingers crossed)

May 3 '06 #3

P: n/a
oh, key fact you left out. Since you were asking a question about
Access, I assumed you had it installed, including the help files.

SELECT tableX.Field1, Count(tableX.FieldY) AS CountY
FROM tableX
GROUP BY tableX.Field1;

May 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.