Help with Sql statement

blackie1982

Registered User.
Local time
Today, 15:22
Joined
Jul 2, 2004
Messages
18
Hi all,

I want to create a query but Im not sure how to go about doing it. I have a table with a list of machines and any faults that happen to them. I need to be able to bring back just the machine name with a count of the number of faults for each machine. How do I do this?

Thank You
 
Basic structure. I assume you have two tables (but not in the SQL below) therefore you'll need to join them.

SELECT MachineName, Count(MachineName) As TotalFaults
FROM MyTable
ORDER BY Count(MachineName) DESC;
 

Users who are viewing this thread

Back
Top Bottom