SQL Server:两个游标迭代
在 SQL Server 中,我必须使用两个游标来迭代两个表。但我对此有一个问题,因为使用两个游标进行选择的结果包含重复的行。所以我的问题是如何从 SQL Server 中的两个或多个游标进行迭代,因为您必须知道这两个游标相互依赖。
提前致谢。
In SQL Server, I have to use two cursor to iterate from two tables. But I have a problem with this because the result from the select with the two cursor is with duplicate rows. So my question is how to iterate from two or more cursors in SQL Server as you must know that the two cursors are depend on each other.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在选择上进行区分,并且不会有重复的行。
但为什么你需要两个光标呢?我强烈建议您更改该代码!
Try to make a distinct on the select and you don't have duplicate rows.
But why in hell do you need two cursors? I strongly advise you to change that code!