Unanswered: sybase For loop for Querying , every result got from the select statem
i am trying to run this Query , this will produce a output of numerous account numbers .
FROM customer_acct a,
customer_acct_history b LIKE "%000%"
WHERE a.acct_num *= b.acct_num AND acct_type='C'
For every account number returned , by the above query . i am trying to run an another query consisitng of various joins , group by and also order by and selecting the Top 1 out put of that Query . i need to put this in a Loop so that for every account number the 2nd query is Ran and top 1 value is selected and stored in a Temp table . any help to proceed would be much appreciated