I have problem sum of the amount from table books.
+----+-----------+-----------+----------------+
| id | id_book | title | amount |
+----+-----------+-----------+----------------+
| 1 | 1 |Book 1 |[[1],[1]] |
+----+-----------+-----------+----------------+
i want to sum column amount, anyone can help me? thx before.
INNER JOIN (SELECT ,,,,) ON ...) and join on id to get the data i assumming id to be a auto_increment in your table.. also note mine example supports up to 100 array elements if you need more you need to add a other( SELECT 0 UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 )