I am using mssql database. Please help me to execute the sql queries based on output of another sql query as follows.
I have one query like 'select productcode from test' . It lists all the product codes.
Based on above query output, If any one of productcode value from above query is "aaaa" then execute sql query1 otherwise execute sql query2.
Please help me.