尝试在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的错误......”:
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”。
答案 0 :(得分:0)
我将表'um_appl_restriction_list'的字符集更改为'utf8',现在就可以了。