• Hello

    Last question........ I hope....

    Is it possible to loop the query several time with different variable or array list and union all in the same temporary table?

    For example:

    1 loop -----DECLARE temp_con CURSOR FOR SELECT DISTINCT COL_THREE FROM #test_table ORDER BY COL_THREE ASC

    2 loop -----DECLARE temp_con CURSOR FOR SELECT DISTINCT COL_FOUR FROM #test_table ORDER BY COL_FOUR ASC

    3 loop -----DECLARE temp_con CURSOR FOR SELECT DISTINCT COL_FIVE FROM #test_table ORDER BY COL_FIVE ASC

    and so on..

    Regards