I need to return a sum of the value field of table m and along with it the date of the initial field of the field sale_date
, being it has an aggregate function error:
SELECT
sum(m.value),
t.sale_date
from t_transaction t
left join t_movement m on m.transaction_id = t.id
where t.paybox_id = 26
You would need to return the total with the date. The date is the same for all records ...
Note: without t.sale_date
returns total value ...