Solved

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

Posted on 2016-11-21
2
17 Views
Last Modified: 2016-11-27
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.
Screenshot--884-_LI.jpg
0
Comment
Question by:Rob Fried
2 Comments
 
LVL 10

Accepted Solution

by:
Ray earned 250 total points
ID: 41896357
replace the assignmentID with ...
 count(*)

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

Assisted Solution

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

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

Open in new window

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
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://…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

19 Experts available now in Live!

Get 1:1 Help Now