我有一个数组的集合,当前的代码

select apex_collections.c001 from apex_collections where collection_name = 'LOAD_CONTENT'

在屏幕上显示以下内容。
C001号
五百七十
571个
我还有一个名为errortable的表,它的table1id列与c001数组中包含的值匹配。我需要将errortable中的所有记录显示给匹配的用户。在本例中,我想显示errortable中的所有记录,其中table1与“570”或“571”匹配。
我想我需要在apex_collections c001数组中执行一个循环,然后执行类似select*from errortable的操作,其中apex_collections.c001(i)=errortable.table1id
我正在努力寻找如何写这个循环的帮助。

最佳答案

你可以这样做:
select apex_collections.c001 from apex_collections apex inner join errorTable errors on apex.c001 = errors.Table1ID where apex.collection_name = 'LOAD_CONTENT'
inner join将只提供来自errortable的与c001列中包含的值匹配的记录
有关内部连接的更多信息,请查看specification of Microsoft

09-09 20:57