Skip to content
Advertisement

Calculate SUM from one table and display columns from another

I have 2 tables, Employee, and Transaction

Transaction

tID cID carID eID tDate PickupDate ReturnDate Amount_Due

Employee

eID fName lName Job Manager Hired

I need to calculate the commission (2.5%) and display that along with fName and lName.

I’ve calculated the commission, I think I’ve done the join correctly but can’t quite figure out how to add in a SELECT to show the other two columns.

Advertisement

Answer

You are grouping by the wrong columns, and you are trying to select Amount_Due and aggregate it at the same time:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement