I need to sort date
in concat
within group_concat
while my query is running fine:
SELECT
report.`Name`,
GROUP_CONCAT(
CONCAT(
"[",
DATE(report.Date) --(not working) order by DATE(report.Date) ,
',',
report.ProductPrice --(not working) order by DATE(report.ProductPrice) ,
"]"
)
) AS ProductPrice
FROM report
GROUP BY report.Name ;
You should use it in group_concat
, not concat
:
group_concat(
concat('[', date(report.Date), ',', report.ProductPrice, ']')
order by date(report.Date) desc
)