confused

polina

Registered User.
Local time
Today, 00:42
Joined
Aug 21, 2002
Messages
100
hi

I have the table

RecordID Transit AssetType
1 12 1
2 12 1
3 13 1
4 12 2

I need a query to count how many record belongs to what transit

So based on this example I would get

Transit: 12
AssetTYpe:1
Count: 2

Transit:13
AssetTYpe:1
Count:1

Transit:12
AssetType:2
Count:1

Please help me with this query
I got confused

Thanks
 
SELECT Transit, AssetType, Count(RecordID) As Count
FROM YourTable
GROUP BY Transit, AssetType
;

RV
 
SELECT Transit, AssetType, COUNT(*) AS Records FROM someTable
GROUP BY Transit, AssetType;

RichM
 

Users who are viewing this thread

Back
Top Bottom