Reputation: 322
Can anybody suggest how to convert this code into SQLAlchemy code?
ARRAY_AGG(DISTINCT (table.column_a, table.column_b)) AS label
Upvotes: 3
Views: 4816
Reputation: 322
Found the solution
from sqlalchemy import func
func.array_agg(func.distinct(table.column_a, table.column_b)).label('my_label')
Upvotes: 5