select username,to_number(substr(data,1,10)) cnt,to_number(substr(data,11)) avgfrom ( select a.username,(select to_char(count(*),'fm0000000009') ||avg(object_id) from all_objects b where b.owner=a.username) data from all_users a )
(2).创建对象类型
createorreplace type myType as object (cnt number,avgnumber); select username,a.data.cnt,a.data.avgfrom ( select username,(select myType(count(*),avg(object_id)) from all_objects b where b.owner=a.username) data from all_users a ) a;