tags:

views:

35

answers:

2

please tell me how to write this query

i have an access table

number
2
2
1
2
2
1
1
3
2

i want a query that gives

number     count
2            5
1            3
3            1

any help appreciated

+3  A: 

something like...

SELECT number, count(number) AS count
FROM table
GROUP BY number
kevchadders
+1  A: 

It's a bad idea to have a column named number since it is a reserved keyword.

You probably want something like

select number_, count(*) as count from ... group by number_
René Nyffenegger