将行号添加到表中的字段
我正在尝试获取此查询的输出,并在表中创建一个将显示的列:
SELECT cons_id, credited_date,
ROW_NUMBER() OVER (partition by cons_id order by cons_id) AS Row_Counter
FROM fy23_jul_aug_anniv_jv;
我在表中创建了一个名为Counter的列,但似乎无法弄清楚如何使用其输出来更新它上述查询。请帮忙!谢谢!!
这是输出:
I'm trying to take the output of this query and create a column in my table that will display it:
SELECT cons_id, credited_date,
ROW_NUMBER() OVER (partition by cons_id order by cons_id) AS Row_Counter
FROM fy23_jul_aug_anniv_jv;
I created a column in my table called COUNTER but cannot seem to be able to figure out how to update it with the output of the above query. Please help! Thanks!!
Here is the output:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用以下查询:
它将在您在查询中选择的其他两个列上使用原始表加入子查询,并将Row_number分配给原始表。
要进行更多故障排除,如果您可以从输入表中共享样本并相应的预期输出,我可以进一步提供帮助。
Try using the following query:
It will join the subquery with your original table on the two other columns that you're selecting in your query, and assign the row_number to your original table.
For more troubleshooting, I can help further if you can share samples from your input tables and corresponding expected output.