cursor xx is SELECT case a when 1 then t1.field1, t1.field2, t1.field3...t1.fieldn when 2 then t2.field1, t2.field2, t2.field3...t2.fieldn ELSENULLEND FROM table1 t1, table2 t2
有個(gè)辦法,比較麻煩, 建一個(gè)臨時(shí)表table3 like table1 if (a=1) then insert into table3 select * from table1; elsif (a=2) then insert into table3 select * from table2; end if;