0
I need to return a sum of the value field of the table m and together with it the date of the initial field of the field sale_date
, and showing 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 accompanied by the date. The date is the same for all records...
Note: without the t.sale_date
returns the total of value...
So I’ve done this process before, but I stop totaling the values... What I want from id 26: value / sale_date 364.54 / 2018-01-08 12:07:43.68
– aleestevao
then sale_date is not the same for movements. Put your table structure and a sample of data you have in them please, plus an example of how you want to output the data @aleestevao
– Rovann Linhalis
Rovann, I solved the problem by creating two queries. Thank you!
– aleestevao