1 回答
TA贡献1829条经验 获得超6个赞
你在追求这样的东西不是吗?
查询1:
SELECT
`substance_id` ,
`display_id`,
GROUP_CONCAT( `generated_text` SEPARATOR '<br>' ) as concact_text
from generated_text_tbl
group by
`substance_id` ,
`display_id`
结果:
| substance_id | display_id | concact_text |
|--------------|------------|--------------|
| 38 | 27 | xyz |
| 54 | 139 | foo<br>bar |
| 1933 | 139 | baz |
查询2:
SELECT
`substance_id` ,
`display_id`,
GROUP_CONCAT( `generated_text` ORDER BY id DESC SEPARATOR '<br>') as concact_reverse_text
from generated_text_tbl
group by
`substance_id` ,
`display_id`
结果:
| substance_id | display_id | concact_reverse_text |
|--------------|------------|----------------------|
| 38 | 27 | xyz |
| 54 | 139 | bar<br>foo |
| 1933 | 139 | baz |
- 1 回答
- 0 关注
- 114 浏览
添加回答
举报