narasiman rao

narasiman rao

  • NA
  • 519
  • 766.9k

how to concatenate the two columns in sql server

Nov 19 2015 5:52 AM
 
   My query as follows

select a.stud_name,
BatchID = (select eid from BATCHID where bid = 'B10458' and b_activ = 'A'),
Cid = (select top 1 certificate_no from certificate_detail where stud_id = a.stud_id and active = 'A' and crsname = 'RPSCRB')
from student a, course_registration b, batch_course_registration c where
a.stud_id=b.stud_id and b.cr_bill_no=c.cr_bill_no
and c.bcr_batch_id= 'B10458'
and b.cr_active='A' and a.stud_active<>'D'

When i run the above query output as follows

stud_name         Batchid             Cid
Ram                   RPSCRB/B01       1


i want to concatenate the Batchid and Cid and get the output as follows

stud_name       Batchid          Cid               Result
Ram           RPSCRB/B01         1      RPSCRB/B01/1


from using above query how can i concatenate the Batchid and Cid. 

Answers (1)