Join + Nested Object
I everyone 👋 . Before I ask my question, I know that there's already another question with the exact same title. I went through it hoping to find a solution there but to no avail. I'm trying to do the exact same thing as him (join two tables but join one as a property under the other table.
The two tables in question here are
lodges
and lodge_conditions
. I just wanna make a query such that I'll get back something of the type
without having to perform 2 separate queries.
Here's what I've tried so far:
But it's giving me the following error:
Database: MariaDB (MySQL) 10.6.1
Solution:Jump to solution
Hey 👋
This is not supported in MariaDB, or old MySQL versions.
Look into the source code of the helper for inspiration. Try a CTE or subquery that creates a record set of
conditions_id
and JSON object as columns and join with it on conditions_id
and select just the JSON object column....2 Replies
Solution
Hey 👋
This is not supported in MariaDB, or old MySQL versions.
Look into the source code of the helper for inspiration. Try a CTE or subquery that creates a record set of
conditions_id
and JSON object as columns and join with it on conditions_id
and select just the JSON object column.okay