-
[Resolved]mysql question
Is it possible to do something like this:
Select (amount*days*people) as totalCost, sum(amtPaid) as amountPaid, (amountPaid - totalCost) as thisparthere?
Where I compute 2 fields and then do a calculation on them? I have been trying it, but I can't find a way to do it.
Would I have to use a temporary table or a view?
-
Re: mysql question
I don't know, but that is a good question. Could totalCost be a subquery? I suppose instead of using totalCost in (amountPaid - totalCost) you could substitute the subquery for totalCost.
There are a lot better SQL folk here than me, but maybe this would work for you.
-
Re: mysql question
I decided to go with a view, although I think a subquery would have worked as well.