【发布时间】:2020-02-19 05:34:31
【问题描述】:
我有两张桌子,比如说:
Table 1
id, name, place
1, a, b
2, c, d
3, e, f
Table 2
id,text
1, hello
1, bye
1, what
2, tired
期望的输出
id, name, place, text
1, a, b, hello or bye or what (any one of the three)
2, c, d, tired
我看过很多帖子,但我找不到类似的东西。我是 SQL/Postgresql 的新手。我在 PostgreSQL 里做。
【问题讨论】:
-
所以你想要一个数组还是什么?
-
@andronicus 我只想要任何 1 值,因为它是我无法使用 min() 或 max() 的文本
-
这不清楚。请通过编辑而不是 cmets 进行澄清。用足够的词。在代码问题中,请提供minimal reproducible example。 How to Ask
标签: sql postgresql group-by aggregate inner-join