尝试更改 Mysql Workbench 中的视图时出现错误。观点是:
CREATE VIEW `ct_objects_v` AS
SELECT
*
from
ct_objects as ct_o
where
exists( select
1
from
um_appl_restriction_list as um_rl
where
ct_o.ID = um_rl.OBJ_ID
and um_rl.OBJECT_TYPE = 'CT_OBJECTS')
当改变它时,我得到“错误解析 DDL for ...”:
delimiter $$
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ct_objects_v` AS
select `ct_o`.`ID` AS `ID`,`ct_o`.`NAME` AS `NAME`,`ct_o`.`MAP` AS `MAP`,`ct_o`.`DESCR` AS `DESCR`,`ct_o`.`ADRESS` AS `ADRESS`,`ct_o`.`NT_CITY_ID` AS `NT_CITY_ID`,`ct_o`.`CT_CATEGORY_ID` AS `CT_CATEGORY_ID`,`ct_o`.`WORKTIME` AS `WORKTIME`,`ct_o`.`INETADRESS` AS `INETADRESS`,`ct_o`.`CONTACTS` AS `CONTACTS` from `ct_objects` `ct_o` where exists(select 1 AS `1` from `um_appl_restriction_list` `um_rl` where ((`ct_o`.`ID` = `um_rl`.`OBJ_ID`) and (`um_rl`.`OBJECT_TYPE` = _cp1251'CT_OBJECTS')))$$
SQL 编辑器将我指向“CT_OBJECTS”作为错误提示:“语法错误,意外的 STRING_TEXT”。