消息102,级别15,状态1,行14''''附近的语法不正确。 [英] Msg 102, level 15, state 1, line 14 incorrect syntax near ')'.

查看:139
本文介绍了消息102,级别15,状态1,行14''''附近的语法不正确。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select collection_date,Collection_time,Branch_code,company_id,rec_series,receipt_number,FirstSet.receipt,account_number,account_type,collected_amount,agent_code
from (select collection_date,Collection_time,Branch_code,company_id,rec_series,receipt_number,receipt,account_number,account_type,collected_amount,agent_code
from missing where collection_date between '2016-02-19' AND '2016-02-23'  and rec_series ='SP18')as FirstSet    
inner join
 (SELECT  TOP 1
        receipt + 1
FROM    misseddata mo
WHERE   NOT EXISTS
(
        SELECT  NULL
        FROM    misseddata mi 
        WHERE   mi.receipt = mo.receipt + 1
)
        group BY receipt ) 





我尝试过:



加入两个表来获取缺失记录并收到错误消息

(Msg 102,Level 15,State 1,第14行

')'附近的语法不正确。不管我错在哪里



What I have tried:

joined two table to get the missing record and getting the error message
( Msg 102, Level 15, State 1, Line 14
Incorrect syntax near ')'. Dont na where i went wrong

推荐答案

你需要别名并在最后加入表格。



就像你有这个:

You need to alias and join the table at the end.

It's like you have this:
SELECT *
FROM table1
INNER JOIN table2 





最后你没有加入条款。



You have no join clause at the end.


这篇关于消息102,级别15,状态1,行14''''附近的语法不正确。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆