Screen Link:
My Code:
SELECT first_name || last_name AS name, (SELECT SUM(total)
FROM invoice
WHERE customer_id = 18) AS total
FROM customer
WHERE customer.customer_id = 18
What I expected to happen:
What actually happened:
Something is wrong with the subquery.
The subquery returned the wrong value.
It should have returned Michelle Brooks, but it returned 79.2 instead.
Not sure where I am making the mistake here. My output is correct
because I am getting one name and one number