My query as follows
select BatchID = (select eid from BATCHID where bid = 'B16401' and b_activ = <>'d'
Cid = (select top 1 certificate_no from certificate_detail where stud_id = a.stud_id and active = 'A' and crsname = 'ctf' )
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='B16401' and b.cr_active='A' and a.stud_active<>'D'
Wheni exeucte the above query output as follows
Batchid Cid
CTF/B376 09
I want to combine the above batchid and Cid and get the output as follows
Batchid Cid Batch
CTF/B376 09 CTF/B376/09
for that how can i combine the two columns in sql server
解决方案Adapt:
select column1, column2, column1 + '/' + column2 newcolumnname from tablename
You may take into consideration the following scenarios:
1. Trimming[^] values.
2. ISNULL[^] values.