select serial_no, sxbh, spbmmc, CONVERT(varchar, spczyxh) spczyxh, spczyxm, spyjmc, spxxsm, sprq, grqmtp, zwmc
from (
select 0 as serial_no, a.sxbh, a.spbmmc, a.spczyxh as spczyxh, a.spczyxm as spczyxm, '' as spyjmc, '' as spxxsm,
'' as sprq, '' as grqmtp, a.zwmc
from maw_request_audi_flow a
where a.splx=13 and a.zjlyxh=0 and isnull(kfdm,'')='30902000'
and a.syzt=0 and ((money_b =0 and money_e =0) or (money_b<=0 and money_e >0))
and a.sxbh = (select max(sxbh)
from maw_request_audi_record
where jlzt in(2,4)
and syzt=0 and zdxh=8 and splx=13) and a.tjrxybz=0
and a.serial_no not in(select sqsplcxh
from maw_request_audi_record
where syzt=0 and jlzt in(2,4) and zdxh=8 and splx=13)
)
上面的语句提示:
消息 102,级别 15,状态 1,第 15 行
“)”附近有语法错误。
最后一个括号错在哪里?加上与去掉都报错,而from里的子查询是可以的,不报错。
<p>提示不一定准确。上面语句在postgresql里提示如下<img height="372" src="https://oscimg.oschina.net/oscnet/91a6b8c9edd775cbffa87686948dbaa5044.jpg" width="728"></p>
大神,谢谢的你回答,加上别名,果然好了!
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。