How do I show the total amount of a equipment used on a assignment?

Posted on 2016-11-21
Last Modified: 2016-12-28
I need the total amount of times a piece of equipment was used in a assignment. Not sure if to use a count statement or group by.
Question by:Rob Fried
LVL 10

Accepted Solution

Ray earned 250 total points
ID: 41896357
replace the assignmentID with ...

then at the very end add ....
GROUP BY equipment.serialno, name
LVL 25

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 250 total points
ID: 41896814

SELECT e.SerialNo AS [Serial No] , MAX(Name) AS Name, COUNT(*) AS [TotalNumberOfTimeEquipmentIsUsed]
FROM Equipment AS e
ON e.SerialNo = a.SerialNo
GROUP BY e.SerialNo 

Open in new window


Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP - modify class to use temporary MySQL table? 15 53
Constructing a Query Using Escaped Variables 3 43
PHP loop not working 4 56
Excel - SQL export question 3 19
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now