1
我有两个对象关系表:person_table
和account_table
,构建于对象person
和account
之外。 一个帐户行为所有共享该帐户的人员提供了一个嵌套表格,其类型为'customer_list'。从嵌套引用表中选择查询
create type person as object(
id integer,
name varchar2,
phone varchar2
);
create type customer_list as table of ref person;
create type account as object(
accid integer,
owned_by customer_list,
balance Integer
);
create table account_table of account;
create table person_table of person;
我想选择由特定人员拥有的所有帐户,只要该人员的ID。如何浏览所有嵌入的帐户表,查询是什么?我尝试了不成功的查询。
例如
select a.*
from account_table a
where table(a.owned_by) = (select ref(p) from person_table p where p.id=id_given);
谢谢
我编辑了您的问题以标准化对象名称。 – APC
谢谢,这是更好 –