2

I am trying to group_concat using SQLAlchemy. The problem is I want to change the separator from , to :

### code #####
.......
db.session.query(c1.ID,c1.cap ,func.group_concat(c1.Name.distinct(), ':' )).join(c2,(chart1.ID == c2.ID)).filter(c1.cap ==82).group_by(c1.ID).all()

It gives the below output:

[('ECE358', 82, 'CNT:,DB:')]

But I want the below:

[('ECE358', 82, 'CNT:DB')]
Ilja Everilä
  • 50,538
  • 7
  • 126
  • 127
Sam
  • 41
  • 1

0 Answers0