当我执行查询显示错误 [英] When I Execute The Query Shows Error

查看:47
本文介绍了当我执行查询显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select b.stud_id, stud_name, srm_rank_code, stud_birth_place, stud_indos, stud_addr_1, stud_place, stud_state
                   stud_pincode, stud_country, stud_telephone, stud_mobile, stud_email, stud_dob, stud_pp_no, stud_pp_issue, stud_pp_idt
                   stud_cdc_no, stud_cdc_issue, stud_cdc_idt, stud_company, stud_seatime,
                   (select file_data  from file_system.dbo.FileDatas where delstate<>1 and
                   [file_id]= (select top 1 [file_ID] from stud_File_map f
                   where f.stud_id=s.stud_id and delstate<>1 and file_map_type='PHOTO')) as 'PHOTO'
                   (select file_data  from file_system.dbo.FileDatas where delstate<>1 and
                   [file_id]= (select top 1 [file_ID] from stud_File_map f
                   where f.stud_id=s.stud_id and delstate <> 1 and file_map_type='SIGNATURE')) as 'SIGNATURE'

                   from  batch_course_registration a,
                   course_registration b, student s where s.stud_id = b.stud_id and s.stud_active <> 'D' and
                   b.cr_bill_no=a.cr_bill_no and a.bcr_batch_id= 'B8753' and b.cr_active='A'







当我执行上述查询时,显示错误如下



关键字'as'附近的语法不正确。



请帮我查询错误我是什么意思制作。



问候

Narasiman P.




When i execute the above query shows error as follows

Incorrect syntax near the keyword 'as'.

please help me from my query what is the mistake i made.

Regards
Narasiman P.

推荐答案

看看在您的查询中,它将显示为PHOTO - 您立即进入另一个子查询...应该有一个 AND



这是一个非常糟糕的SQL - 而不是所有这些子查询都考虑使用一些连接......如果没有别的话,它会更容易阅读
Have a look at your query where it says as 'PHOTO' - you immediately go into another sub-query ... there should be an AND or an OR

That is a truly awful piece of SQL - instead of all of those sub-queries consider using some joins instead ... it will be easier to read if nothing else


这篇关于当我执行查询显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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