Hi,

Someone pls correct the error.

SELECT orderid, merchant, buyprice, commission, refund, (buyprice - refund) as expenseOrder , (commission - expenseOrder )  as profitt
FROM business
WHERE merchant LIKE "GO%"

error:
MySQL said: Documentation
#1054 - Unknown column 'expenseOrder' in 'field list'

Thanks.

Thanks. it worked.
one more question:

SELECT orderid, merchant, buyprice, commission, refund, (
buyprice - refund - commission
) AS profitOfEchOrder
FROM business
WHERE merchant LIKE "GO%"

Above code works.
Now how can i SUM profitOfEchOrder?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.