2016-12-13 96 views
0

我收到一條錯誤消息,說我缺少一個關鍵字。然而,我看不到我缺少的東西。任何幫助傢伙?缺失關鍵字SQL

下面是代碼:

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; 
+0

'AS'在視圖名後失蹤 –

回答

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;