求教怎样查询一个表内一个列(是一个数据类型)中的单个属性
我建了一个表:CUSTOMER.
SQL> desc customer;
Name Null? Type
----------- ----- -----------------
CUSTOMER_ID NUMBER
PERSON PERSON_TY
SQL> select * from customer;
CUSTOMER_ID
-----------
PERSON(NAME, ADDRESS(STREET, CITY, STATE, ZIP))
--------------------------------------------------------------------------------
1
PERSON_TY('NEIL MULLANE', ADDRESS_TY('57 MT PLEASANT ST', 'FINN', 'NH', 11111))
2
PERSON_TY('SEYMOUR HESTER', ADDRESS_TY('1 STEPAHEAD RD', 'BRIANT', 'NH', 11111))
其中person_ty,address_ty都是我自己定义的数据类型.
SQL> select column_name,data_type from user_tab_columns where table_name = 'CUSTOMER';
COLUMN_NAME DATA_TYPE
------------------------------ ----------
CUSTOMER_ID NUMBER
PERSON PERSON_TY
SQL> select attr_name,length,attr_type_name from user_type_attrs where type_name = 'PERSON_TY';
ATTR_NAME LENGTH ATTR_TYPE_NAME
------------------------------ ---------- ------------------------------
NAME 25 VARCHAR2
ADDRESS ADDRESS_TY
SQL> C /PERSON_TY/ADDRESS_TY
SQL> /
ATTR_NAME LENGTH ATTR_TYPE_NAME
------------------------------ ---------- ------------------------------
NAME 25 VARCHAR2
ADDRESS ADDRESS_TY
现在,请问怎样才能单独取出name,city的值.