我尝试从嵌套表中进行选择但显示错误消息" ORA-00933:SQL命令未正确结束" 这是选择的要求
select b.NomPlayer from table (select t.players from Team t where t.IdTeam=1) as p;
这是我创建player_type
和team_type
CREATE OR REPLACE TYPE Player_Type AS OBJECT ( Num_Licence NUMBER, NomPlayer VARCHAR2(30)) ;
CREATE TYPE PlayersNT AS TABLE OF ref Player_Type ;
CREATE TYPE Team_Type AS OBJECT ( IdTeam NUMBER, TeamName VARCHAR2(30), Players PlayersNT ) ;
CREATE TABLE Player OF Player_Type ;
CREATE TABLE Team OF Team_Type
NESTED TABLE Players STORE AS PlayersTab ;
答案 0 :(得分:0)
删除AS
子句中的FROM
。与其他数据库不同,Oracle仅允许AS
子句中的SELECT
。
select * from table(select t.players from Team t where t.IdTeam=1) p;