Hey guys, I need a little help with a SQL problem.
I have two tables
Code:
|----------------
--------------| | CAR |
| PERSON | | |
| | |*carid |
|*personid | |carcost |
|persfname | | carsell |
|perslname | | cartype |
|--------------- -----------------
the question asks
list details of all sales showing the gross profit (selling price minus cost price.)
I know I need
Code:
Select person.*, car.*
from person, car
Now what I'm not sure of is the minus part. I know how to do AVG, SUM, COUNT etc, but am not sure how to subtract the carsell from the carcost.
I'm pretty sure it needs to be in the select statement. Just need a little reminder here.
thanks.
for some reason the | are all screwed up.