[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2016-11-21
2
Medium Priority
?
78 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 32

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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 …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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

656 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