2
I have two tables, customers
and payments
, I want to verify from each customer which was the largest and smallest payment each made.
I did this SQL, but it didn’t work, someone could help me?
SELECT c.customerName, max(p.amount), min(p.amount)
FROM customers c, payments p
WHERE p.customerNumber = c.customerNumber
ORDER BY c.customerNumber
Just for the record, the name of the tables are in Portuguese or English?
– Caio Felipe Pereira
Which error returned? This is the GROUP BY clause.
– Giancarlo Abel Giulian