1

I have a table which contains a column with different items which i would like to count by there type. For example the table looks like the following:

Id |  Type
---|----
1  | Table
2  | Table
3  | TV
4  | TV
5  | Table
6  | TV
7  | TV

The result should looks like:

Type  | NumOfItems
------|----------
Table | 3
TV    | 4

I use the following code which doesn't work for my Access 2003:

SELECT Table1.Type, Count(Table1.Type) AS NumOfItems
FROM Table1
Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
Anna
  • 23
  • 2

1 Answers1

0

You need to add GROUP BY Table1.Type to the end of the query.

keelerm
  • 116
  • 1
  • Thanks! this has helped! Maybe you also know how to add the TOTAL line in the output table? Would be very thankful. – Anna Jun 25 '12 at 03:52