起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2585|回复: 2

[结贴] ksql错误,找不到问题

[复制链接]

115

主题

379

帖子

1072

积分

金牌会员

Rank: 6Rank: 6

积分
1072
QQ
发表于 2017-5-22 09:36:09 | 显示全部楼层 |阅读模式
如下ksql,报错说1337 缺少右括号,可该sql放在mysql里是可执行的
select f.fileName,l.syear,l.mont1,l.mont2,l.mont3,l.mont4,l.mont5,l.mont6,l.mont7,l.mont8,l.mont9,l.mont10,l.mont11,l.mont12
  from (SELECT t.fileName,t.fileCode from t_files t JOIN t_file_detail t2 on t.fileCode = t2.fileCode where t.fileType = 1 and t2.unitId = '010000' and t2.delFlag = 0) f  JOIN
  (SELECT        licenseCode,        licenseClass,year(t_license.applyDatetime) as syear,
case when month(t_license.applyDatetime)  = '1' then 1 else 0 end as mont1,
case when month(t_license.applyDatetime)  = '2' then 1 else 0 end as mont2,
case when month(t_license.applyDatetime) = '3' then 1 else 0 end as mont3,
case when month(t_license.applyDatetime) = '4' then 1 else 0 end as mont4,
case when month(t_license.applyDatetime) = '5' then 1 else 0 end as mont5,
case when month(t_license.applyDatetime) = '6' then 1 else 0 end as mont6,
case when month(t_license.applyDatetime) = '7' then 1 else 0 end as mont7,
case when month(t_license.applyDatetime) = '8' then 1 else 0 end as mont8,
case when month(t_license.applyDatetime) = '9' then 1 else 0 end as mont9,
case when month(t_license.applyDatetime) = '10' then 1 else 0 end as mont10,
case when month(t_license.applyDatetime) = '11' then 1 else 0 end as mont11,
case when month(t_license.applyDatetime) = '12' then 1 else 0 end as mont12
FROM        t_license_detail
JOIN t_license ON t_license_detail.applyIdkey = t_license.idkey
WHERE year(t_license.applyDatetime)=:syear
order BY licenseCode,licenseClass) l  on f.fileCode =  l.licenseCode

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36109
发表于 2017-5-22 10:58:33 | 显示全部楼层
ksql中概念必须去别名
ksql.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

115

主题

379

帖子

1072

积分

金牌会员

Rank: 6Rank: 6

积分
1072
QQ
 楼主| 发表于 2017-5-22 14:34:17 | 显示全部楼层
jishuang 发表于 2017-5-22 10:58
ksql中概念必须去别名

好,晓得了,谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-2-26 06:22 , Processed in 0.057816 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表