Skip to content
Advertisement

Tag: arrays

Merge Two JSON array columns in Mysql 8

I am using Mysql (version > 8). I have a table where I am storing unique customer ids for the day in an JSON field as an array. I need to query for all unique customers in last 30 days. I am unable to find an equivalent mysql query for the same. I am using JSON_ARRAYAGG to first merge all

How to get Table field names at top of result array

Here is my Sample table: Here is My Query: Result for above query is: I need to get the field names in the first element of the array. Expected result array is: How can I modify the Query to get this result? Thanks in advance… Answer Display issues should generally be dealt with in application code, not SQL queries. If

Advertisement