在 Postgres 中结合 row_number() 和字符串列

发布于 2024-08-09 02:54:02 字数 207 浏览 2 评论 0原文

我需要将字符串列和 row_number() 计算的结果结合起来 成一列。

我得到的是第 1 列,包含字符串,第 2 列包含 row_number() 结果。现在我将两者合二为一。

Postgres 中这是什么方式?我认为简单的 +& 并不 锻炼。

I need to combine to a string column and the result of a row_number() calculation
into one column.

What I've got is column 1, containing strings and column 2, containing the row_number() result. Now I to combine both into one.

What's the way of this in Postgres? I figured that a simple + or & does not
work out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如此安好 2024-08-16 02:54:02

我自己想出来了:

table.col || ' ' || row_number()... 

Figured it out myself:

table.col || ' ' || row_number()... 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文