narasiman rao

narasiman rao

  • NA
  • 519
  • 768.4k

how to insert a empty row using sql server

Mar 11 2015 6:37 AM
 
 First Query as follows
select distinct Course = case cr.cpm_pkg_id WHEN '' THEN cr.cmn_minor_code else cbm.cmn_minor_code end
from course_registration cr, batch_course_registration bcr, co_batch_master cbm where bcr.cr_bill_no
= cr.cr_bill_no and cbm.cbm_batch_id = bcr.bcr_batch_id and cr.cr_active = 'A'
and cr.stud_id = '53248'

When i run the above query output as follows
Course
GPrating

Second Query as follows
select distinct a.pm_prof_code as Code,a.sp_cert_no as Certificate_No,
a.sp_issu_authority as Issue_Authority, convert(char(14),a.sp_issu_dt,106) as Issue_Date
from student_professional a,tb_courseelg_settings b
where a.pm_prof_code= b.courseelg and b.coursename = 'GPRATING'and a.stud_id = '53248'

When i run the second query output as follows
Code Certificate_NO Issue_Authority Issue_Date
output is null

Because in second query in tb_courseelg_settings table GPRATING course is not there.
so second query output is null.


When i run the first query for stud_id ' 53248' output is follows
Course
GPRATING

So when i run the second query i want output as follows
Code Certificate_NO Issue_Authority Issue_Date
Gprating

for that how can i do using sql server.