Hi, thanks for the reply. I need the output to be like below:-
<Accts>
<Acct>94615130</Acct>
<Items>
<ITEM>1001</ITEM>
</Items>
<Items>
<ITEM>1050</ITEM>
</Items>
<Items>
<ITEM>1051</ITEM>
</Items>
<Items>
<ITEM>1054</ITEM>
</Items>
<Items>
<ITEM>1055</ITEM>
</Items>
....
</Accts>
But I need the where clause in the sub query to be like Item1.Code = Item.code AND Item1.ItemNo...