I have a question.
When I run this code on this dataset:
SELECT a.customerNumber, a.checkNumber
FROM (SELECT customerNumber,
checkNumber, min(paymentDate) as paymentDate
FROM payments
GROUP BYcustomerNumber) AS a;
I was wondering when I do not specify other columns that are not used in group by function. MySQL allows me to do that, but I rememberer that without specifying other columns, I would get this message, You tried to execute a query that does not include the specified expression 'one of column' as part of an aggregate function.
Am I missing some key points here? I think MySQL will automatically return the first entry of unspecified column without specifying this column in an aggregate function.
GROUP BYis not a function, it is a clause.