缺少关键词SQL

时间:2016-12-13 14:22:08

标签: sql oracle

我收到一条错误消息,说我错过了一个关键字。但是,我看不出我错过了什么。任何帮助人?

以下是代码:

CREATE OR REPLACE VIEW viewHolidayID
SELECT
DECODE (Country_Visted, 'USA','America',
        'India', 'Asia',
        'China', 'Asia',
        'Spain', 'Europe') AS continental, Package_Code, Description, Country_Visted FROM tbl_Holiday_Details;
SELECT * FROM viewHolidayID;

1 个答案:

答案 0 :(得分:2)

syntaxCREATE ... viewHolidayID AS select ...

CREATE OR REPLACE VIEW viewHolidayID 
AS
SELECT
 DECODE (Country_Visted,
          'USA'   , 'America',
          'India' , 'Asia',
          'China' , 'Asia',
          'Spain' , 'Europe'
        ) AS continental,
 Package_Code,
 Description,
 Country_Visted
FROM tbl_Holiday_Details;