0
Good afternoon, would like to know if it is possible to perform a query summing some values and create a column with the ids in which the values were summed.
-- table 'value'
| id | value | status |
| 1 | 100.00 | 0 |
| 2 | 200.00 | 1 |
| 3 | 300.00 | 0 |
| 4 | 400.00 | 1 |
-- sql
select sum(value) as sum from value V Where V.status = 1
-- exit
| summing up |
| 600.00 |
But I’d like the exit to stay that way.
-- desired exit
| soma | ids |
| 600.00 | 2,4 |
How could I make that appointment?
From now on. Thank you.
It worked!!!!! but the command is GROUP_CONCAT()... BRAWL!!!
– Tiago Igreja