Select nvl(tCwZtInforTable1, ' '), nvl(tCwZtInforTable2, ' '), nvl(tCwZtInforTable3, ' '), nvl(tCwZtInforTable4, ' ') nvl(tCwZtInforTable5, ' ') into sTbl1,sTbl2,sTbl3,sTbl4,sTbl5 From tCwZtInfor Where tCwZtInforCode = InZtCode and (tCwZtInforTable1 is not null or tCwZtInforTable2 is not null or tCwZtInforTable3 is not null or tCwZtInforTable4 is not null or tCwZtInforTable5 is not null )
也就是说,我要把5个字段中不为空的查出来并ASSIGN 到变量中。有没有其他思路?
nvl(tCwZtInforTable2, ' '),
nvl(tCwZtInforTable3, ' '),
nvl(tCwZtInforTable4, ' ')
nvl(tCwZtInforTable5, ' ')
into sTbl1,sTbl2,sTbl3,sTbl4,sTbl5
From tCwZtInfor
Where tCwZtInforCode = InZtCode
and (tCwZtInforTable1 is not null
or tCwZtInforTable2 is not null
or tCwZtInforTable3 is not null
or tCwZtInforTable4 is not null
or tCwZtInforTable5 is not null
)