Hi I got a requirement as follows .... I have two tables table1 and table2 with data. The following screen shot is for understanding how the data spreads. Table1: col --- R1 R2 R3 R4 .. RN Table2: col1 col2 col3 col4 .. colN we do not know many rows in table1. depends on no of rows of table1 , the no of cols are to be selected from table2. Awaiting for update.