f***e 发帖数: 17 | 1 我define 了table department,里面有nested table cars,现在怎么count 一共
有多少cars for all departments.
create or replace type CARTYPE as object
(
VIN NUMBER(17),
YEAR NUMBER(4),
MODEL VARCHAR2(60)
);
/
create or replace type CARTABLETYPE as table of CARTYPE;
/
create table Dept(
deptID integer constraint dept_pk primary key,
dname char(20) not null,
cars CartableType
)
nested table cars store as Cartable;
然后我用:
select sum(count(c.*)) from dept D,table(d.cars) c; | n********a 发帖数: 68 | 2 select count(*) from dept d, table(d.cars) c;
【在 f***e 的大作中提到】 : 我define 了table department,里面有nested table cars,现在怎么count 一共 : 有多少cars for all departments. : create or replace type CARTYPE as object : ( : VIN NUMBER(17), : YEAR NUMBER(4), : MODEL VARCHAR2(60) : ); : / : create or replace type CARTABLETYPE as table of CARTYPE;
|
|