视图:

create or replace view etl_opr_view

(oprtype,oprtypename ,oprid,code,name,classified,status,projectid

,projectname,principalid ,principal ,description ,remark,crtuserid ,crtuser

,crtdate ,modifypersonid,modifyperson,modifydate

,reqstartdate,reqenddate,planstartdate,planenddate,actualstartdate

,actualenddate,planwork,actualwork,actualcost,severity,priority,completepercent

,filterstartdate, filterenddate

)

as

select 21, '任务', taskid, wbscode, taskname,

(case when metatype='0' then '任务' when metatype='1' then '里程碑'

when metatype='2' then '阶段' when metatype='3' then '交付物' when

metatype='4' then '摘要任务'

end) ,

(case when actualstartdate='' or actualstartdate is null then '未开始' when actualenddate='' or actualenddate is null then '

开始' else '完成'

end) STATUS,

projectid, (select projectname from pj_baseinfo where

projectid=tk_baseinfo.projectid),

inchargepersonid, (select username from org_userinfo where

userid=tk_baseinfo.inchargepersonid),

'', '',

-1,'',null,

modifyperson,(select username from org_userinfo where

userid=tk_baseinfo.modifyperson), modifydate,

null,null,

planstartdate, planenddate,

actualstartdate,actualenddate,

planworkload,actualworkload,0,

'','',completepercent*100

,planstartdate, planenddate

from tk_baseinfo where delflag=0 and completepercent<1

;

创建是成功的,然后导出为.sql文件再导入到另一个库中报错,错误如下:

Query:

/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `etl_opr_view` AS select 95  AS `21`,'任务' AS `任务`,`tk_baseinfo`.`taskid` AS `taskid`,`tk_baseinfo`.`wbscode` AS `wbscode`,`tk_baseinfo`.`taskname` AS `taskname`,(case when (`tk_baseinfo`.`metatype` = '0') then '任务' when (`tk_baseinfo`.`metatype` = '1') then '里程碑' when (`tk_baseinfo`.`metatype` = '2') then '阶段' when (`tk_baseinfo`.`metatype` = '3') then '交付物' when (`tk_baseinfo`.`metatype` = '4') then '摘要任务' end) AS `(case when metatype='0' then '任务' when metatype='1' then '里程碑'

when metatype='2' then '阶段' when metatype='3' then '交付物' when

metatype='4' then '摘要任务'

end)`,(case when ((`tk_baseinfo`.`actualstartdate` = '') or isnull(`tk_baseinfo`.`actualstartdate`)) then '未开始' when ((`tk_baseinfo`.`actualenddate` = '') or isnull(`tk_baseinfo`.`actualenddate`)) then '\n开始' else '完成' end) AS `STATUS`,`tk_baseinfo`.`projectid` AS `projectid`,(select `pj_baseinfo`.`projectname` from `pj_baseinfo` where (`pj_baseinfo`.`projectid` = `tk_baseinfo`.`projectid`)) AS `(select projectname from pj_baseinfo where

projectid=tk_baseinfo.projectid)`,`tk_baseinfo`.`inchargepersonid` AS `inchargepersonid`,(select `org_userinfo`.`UserName` from `org_userinfo` where (`org_userinfo`.`userid` = `tk_baseinfo`.`inchargepersonid`)) AS `(select username from org_userinfo where

userid=tk_baseinfo.inchargepersonid)`,'' AS ``,'' AS ``,-(1) AS `-1`,'' AS ``,NULL AS `NULL`,`tk_baseinfo`.`modifyperson` AS `modifyperson`,(select `org_userinfo`.`UserName` from `org_userinfo` where (`org_userinfo`.`userid` = `tk_baseinfo`.`modifyperson`)) AS `(select username from org_userinfo where

userid=tk_baseinfo.modifyperson)`,`tk_baseinfo`.`modifydate` AS `modifydate`,NULL AS `NULL`,NULL AS `NULL`,`tk_baseinfo`.`planstartdate` AS `planstartdate`,`tk_baseinfo`.`planenddate` AS `planenddate`,`tk_baseinfo`.`actualstartdate` AS `actualstartdate`,`tk_baseinfo`.`actualenddate` AS `actualenddate`,`tk_baseinfo`.`planworkload` AS `planworkload`,`tk_baseinfo`.`actualworkload` AS `actualworkload`,0 AS `0`,'' AS ``,'' AS ``,(`tk_baseinfo`.`completepercent` * 100) AS `completepercent*100`,`tk_baseinfo`.`planstartdate` AS `planstartdate`,`tk_baseinfo`.`planenddate` AS `planenddate` from `tk_baseinfo` where ((`tk_baseinfo`.`delflag` = 0) and (`tk_baseinfo`.`completepercent` < 1)) */

Error occured at:2014-07-17 10:34:00

Line no.:29840

Error Code: 1166 - Incorrect column name '(case when metatype='0' then '任务' when metatype='1' then '里程碑'

when metatype='2' then ''

2014年7月21日 14:55

mysql error code 100_Mysql 导入报错 error code:1166相关推荐

  1. mysql source导入报错ERROR 1366的解决方法

    mysql source导入报错ERROR 1366的解决方法 参考文章: (1)mysql source导入报错ERROR 1366的解决方法 (2)https://www.cnblogs.com/ ...

  2. mysql导入1366_mysql source导入报错ERROR 1366的解决方法

    文件是utf8的,数据库表是utf8的,为什么客户端导入会报错呢? 发现客户端用的是gbk的 改为utf8后正常 SHOW VARIABLES LIKE 'character%'; +-------- ...

  3. MySQL修改root用户密码 报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

    修改 root 密码 alter user user() identified by '数字 & 大写字母 & 小写字母 & 特殊符号'; 是不是觉得密码又难有复杂 没事还有办 ...

  4. MySQL修改密码时,报错ERROR 1064 (42000)【新版MySQL修改密码命令有所变更】

    相信大家都遇到过这种情况,在用 命令行 运行的 MySQL 中修改密码时,出现以下错误: ERROR 1064 (42000): You have an error in your SQL synta ...

  5. MySQL 8.0.18 导入报错: 'ascii' codec can't decode byte 0xcc in position 26: ordinal not in range(128)

    系统环境 Windows 10 MySQL Server 8.0.18 MySQL Workbench 8.0.18 现象 从A机上导出的数据库备份,无法在B机导入,MySQL Workbench 报 ...

  6. mongodb中文件导入报错error inserting documents解决方法

    相信很多新接触mongdb的朋友在导入数据时都或多或少的遇上些许问题,下面就我遇上的问题做个简单记录. 安装完MongoDB会自带个导入工具:mongoimport,导入的指令为 Usage:mong ...

  7. 安装报错_MySQL8.0安装后,报错ERROR 1045 (28000)

    报错问题: 1.昨天安装Mysql8.0.18,然后使用navicat连接,结果出现: ERROR 1045 (28000): Access denied for user 'root'@'local ...

  8. mysql5.7 1045 pc,解决MySQL5.7报错ERROR 1045 (28000): Access denied for user

    解决MySQL5.7报错ERROR 1045 (28000): Access denied for user 解决MySQL5.7报错ERROR 1045 (28000): Access denied ...

  9. 【安卓开发/报错Error inflating class <unknown>】

    [安卓开发/报错Error inflating class ] 报错Error inflating class <unknown> 错误列表 思路 小知识 总结 报错Error infla ...

最新文章

  1. 聊聊 Kafka 那点破事!
  2. 禁止java更新_禁止:禁止对'replicas','template'和'updateStrategy'以外的字段的statefulset规范进行更新...
  3. java web从入门到精通光盘_0基础入门 IT,Web前端、Java、C++和Linux哪种好?
  4. 性能优化:实现动画效果优先考虑css的transition
  5. jQuery1.9+中删除了live以后的替代方法
  6. 关闭 VSCode 自动更新
  7. java调用python库pyd_Java调用Python的两种方式
  8. 在Visual Studio调试器中显示数组
  9. Mouse Jiggler – 自动移动光标,防止电脑启动屏保、进入休眠[Windows]
  10. 通过apicloud实现的混合开发App的Demo
  11. CCF NOI1022 平均年龄
  12. 【转载】为什么要用黑莓?
  13. ExtJS视频教程1(上)
  14. php adodb 统计,php之adodb简介
  15. LPC1768 Flash 存储器加速模块
  16. 【新知实验室 TRTCIM】实时互动课堂最佳实践
  17. HTML页面如何引入其他HTML页面
  18. 《重说中国近代史》—张鸣—(3)两个世界最初的碰撞(续)
  19. iOS滤镜实现之LOMO(美图秀秀经典LOMO)
  20. PLC常用标志位信号时序编程注意事项

热门文章

  1. 【MySQL】MySQL的数据类型
  2. @4-1 CCF 2020-06-1 线性分类器
  3. 【Java】练习题库 单选题
  4. Lightroom“夏日清凉”调色思路
  5. Android蓝牙开发的各种坑
  6. python字典添加主键_Python--MySql(主键的创建方式、存储引擎、存储过程、索引、pymsql)...
  7. 软件工程实践 项目开始准备
  8. c# 中文数字转阿拉伯数字
  9. 【渝粤题库】陕西师范大学164208 网络营销理论与实务 作业(专升本)
  10. vue3.0“ Uncaught TypeError: Cannot read property ‘use‘ of undefined”报错解决......