Paaro
unread,Apr 9, 2022, 9:45:57 AM4/9/22You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I have following two SQL queries to execute in mySQL.
SELECT total(amount) as total_receipts FROM receipts WHERE torderid = 101
SELECT total(amount) as total_refunds FROM refunds WHERE torderid = 101
I get following below values using these two above queries
total_receipts
total_refunds
Now I need to calculate net_receipts as below.
net_receipts = total_receipts - total_refunds
Is there way to get total_receipts, total_refunds and net_receipts by merging the above two queries into a single SQL query?
Please help.