现在需要将下面的语句转换成sqlalchemy的orm
select name, group_concat(price, order by price desc SEPARATOR '@') from test group by id
目前尝试下来order和SEPARATOR只能使用一个,当在第一个op后面加入第二个op的时候就会出现错误,不知道要如何编写,下面是我的写法,请赐教
select(
name,
func.group_concat(test.c.price).op('order by')(test.c.price)
)
.select_from(test)
.group_by(test.c.id)