【问题标题】:SQL select column array into stringSQL选择列数组到字符串
【发布时间】:2022-06-16 17:34:16
【问题描述】:

SQL 选择列数组为字符串 我的桌子看起来像

table A:
| id | account |
| -- | ------- |
| 1  | kenvin  |
| 2  | charles |

table B:

| id | title       | targetgroup | targetuser |
| -- | ----------- | ----------- | ---------- |
| 1  | promotion A |  1          | []         |
| 2  | promotion B |  1          | []         |
| 3  | promotion c |  4          | [1,2]      |

targetgroup为4时如何将账号加入promotion_table 预期结果(如下部分)

| id | title       | targetgroup | targetuseraccount   |
| -- | ----------- | ----------- | ------------------- |
| 1  | promotion A |  1          | []                  |
| 2  | promotion B |  1          | []                  |
| 3  | promotion c |  4          | ['kenvin','charles']|

【问题讨论】:

  • 您使用的是哪个 dbms?

标签: sql


猜你喜欢
  • 2012-02-26
  • 2022-12-02
  • 2022-07-20
  • 1970-01-01
  • 2022-06-27
  • 1970-01-01
  • 2015-06-21
  • 2015-07-08
  • 1970-01-01
相关资源
最近更新 更多