如何在Storedprocedure中引入行/ colummns的嵌套for循环 - 对于存储过程来说是新的:(我有两个具有相同列的表。我正在尝试迭代表并使用它们的值。
For Each row in Table1
For Each row in Table2
For Each Column
'Here we are in a column Row intersection
my value = value of table1 + value of table 2.
End loop 'Each Column
End loop 'Each row in Table2'
End loop 'Each row in Table1'
任何帮助..提前致谢..
答案 0 :(得分:1)
你可以考虑一个简单的选择来添加这样的值:
select t1.value + t2.value as result
from table1 t1, table2 t2
where t1.pk = t2.fk