Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7522671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:35:23+00:00 2026-05-30T02:35:23+00:00

This is my query, select a.nvrEquipment as [Equiment Name],a.Availability,b.Breakdown,c.Idle from (select nvrEquipment,sum(fltQuantity) as [Availability]

  • 0

This is my query,

select a.nvrEquipment as [Equiment Name],a.Availability,b.Breakdown,c.Idle from 
(select nvrEquipment,sum(fltQuantity) as [Availability] from tblEquipment 
where intstatus in(1,2,3) group by nvrEquipment) a left join 
(select nvrEquipment,sum(fltQuantity) as [Breakdown] from tblEquipment 
where intstatus = 2 group by nvrEquipment) b on a.nvrEquipment=b.nvrEquipment left join
(select nvrEquipment,sum(fltQuantity) as [Idle] from tblEquipment 
where intstatus = 3 group by nvrEquipment) c on a.nvrEquipment=c.nvrEquipment

I need the another column Utilization in %:

Formula is:

Utilization in % = (Breakdown + Idle) / Avalilability * 100

Equiment Name  Availability      Breakdown    Idle    Utilization
Crane            3             1            1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:35:26+00:00Added an answer on May 30, 2026 at 2:35 am

    Seems pretty straightforward:

    select a.nvrEquipment as [Equiment Name],a.Availability,b.Breakdown,c.Idle,
    (b.Breakdown + c.Idle) * 100 / NULLIF(a.Availability, 0) as Utilization
    from 
    (select nvrEquipment,sum(fltQuantity) as [Availability] from tblEquipment 
    where intstatus in(1,2,3) group by nvrEquipment) a left join 
    (select nvrEquipment,sum(fltQuantity) as [Breakdown] from tblEquipment 
    where intstatus = 2 group by nvrEquipment) b on a.nvrEquipment=b.nvrEquipment left join
    (select nvrEquipment,sum(fltQuantity) as [Idle] from tblEquipment 
    where intstatus = 3 group by nvrEquipment) c on a.nvrEquipment=c.nvrEquipment
    
    • I multiplied before dividing to obviate INTEGER rounding, if any.
    • I used NULLIF to handle division-by-zero.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is My Query : SELECT user,name,SUM(price) FROM $tableName WHERE faktor='1' GROUP BY user
I have this query: SELECT (SUM(tblTransaction.AmountPaid) - SUM(tblTransaction.AmountCharged)) AS TenantBalance, tblTransaction.TenantID FROM tblTransaction GROUP
For this query SELECT min(date) min_date FROM order_products group by order_id min_date ignores the
Hi I have written this query SELECT cl_brands.name AS Brand,DATE_FORMAT(cl_doctor_call.date_entered,'%b%y')AS MonthYear, SUM(FIND_IN_SET(CONCAT('^',cl_brands.id,'^'),cl_doctor_call_cstm.brand_discussed_c))AS No_Times_Brand_Discussed FROM
This query: SELECT refPatient_id,actDate,refReason_id,refClinic_id,active FROM PatientClinicHistory WHERE refClinic_id = 24 GROUP BY refPatient_id,actDate,refReason_id,refClinic_id,active ORDER
This is my base query select distinct a.projects , case when(billing_fy!=0) then(select round(((sum(cost_project)/(sum(billing_fy)/((10/12)*365)))),2) from
I have this query: select id from mytable where contains(all_text,'('||?||' within name)*2, ('||?||' within
I am executing this query: SELECT voterfile_county.Name, voterfile_precienct.PREC_ID, voterfile_precienct.Name, COUNT((SELECT voterfile_voter.ID FROM voterfile_voter JOIN
Say I have this query: SELECT bugs.id, bug_color.name FROM bugs, bug_color WHERE bugs.id =
I want to create this query: select Something, count(Something) as Num_Of_Times from tbl_results group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.