insert [ all | first ] when test1 then into t1 ... when test2 then into t2 ... into t3 ... else into t4 ... select * from query;