Lets say i want to select (total Number of Customer from Customer table), as well as (Total Sum of transaction Amount from transaction Table).
I want to list out both result in single query..
select Count(id) from Customer
select Sum(Amount) from Transactions
Please help me to to do.
You can put the two queries in subqueries:
SELECT (SELECT COUNT(*) FROM Customer) AS customers,
(SELECT SUM(amount) FROM Transactions) AS amount
FROM DUAL
You don't need FROM DUAL
if you're doing this in MySQL, you may need it in other databases.