narasiman rao

narasiman rao

  • NA
  • 519
  • 768.4k

When i execute the sql query shows error

Mar 3 2015 9:28 PM
select b.stud_id, stud_name, srm_rank_code, stud_birth_place, stud_indos, stud_addr_1, stud_place, (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'
When i run the above query shows error as follows
Incorrect syntax near the keyword 'as'
The above error shows in below line as follows
where f.stud_id=s.stud_id and delstate <> 1 and file_map_type='SIGNATURE')) as 'SIGNATURE'
please help me what is the mistake i made in above query.
 

Answers (2)