Answer the question
In order to leave comments, you need to log in
How to push all columns from JOIN into one column?
There are two tables:
ads
logs
is joined from logs to ads , and I need the resulting columns from ads to all fit in the "ad" column, so the final result in JSON would look like this:
{
"id": 1,
"column_1": 2,
"ad": {
"id": 1,
"column1": 2,
"column2": 3
}
}
Answer the question
In order to leave comments, you need to log in
Have you tried to search in Yandex?
I entered the query "MySQL for json" the expression "for json" is supported in SQL Server and it is considered the gold standard of the DBMS, so similar functions in other DBMS can be searched by keywords.
Here is the answer, I think it fits.
https://stackoverflow.com/questions/41758870/how-t...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question