I'm having some trouble doing a request in SQL.
My table looks like this
id | storeID | dateDone | paidSum
I need make a request that enables me to make a html table like this
date | store One | store Two | store Tree
08/12 | 2000 | 6000 | 1000
08/13 | 100 | 90 | 10000
So the array should look like this
[
"08/12" => [
"total" => 9999,
"byPlace" => [
"1" => 800,
"2" => 777,
.....
]
],
....
]
Can this be done in one SQL request, or do I have to continue using foreach loops (which takes a looong time to load)?
The database contains +10k entries. I'm using MariaDB