Skip to content
Advertisement

How do I write a group_concat function in sqlalchemy?

I am trying to re-write this mysql query in SQLAlchemy:

Schema:

JavaScript

Query:

JavaScript

Here’s what I have, but I keep getting:

JavaScript

Advertisement

Answer

Defining a custom function element seems the easiest way to take care of the group_concat method.

JavaScript

And use it something like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement