?
Solved

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

Posted on 2016-11-21
2
Medium Priority
?
68 Views
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.
Screenshot--884-_LI.jpg
0
Comment
Question by:Rob Fried
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

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

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

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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