I have a SQL query which has many statements,
select top 1 a.mkey, a.EMP_CARD_NO, a.Emp_Name as EMPLOYEENAME ,convert(varchar,a.date_of_joining,103) as DATEOFJOINING ,
convert(varchar,a.dt_of_leave,103) as DATEOFLEAVING ,a.PF_NO,a.Adhar_card,
(select top 1 Company_Name from company_mst where mkey=a.comp_mkey) COMPANYNAME,
b.Aadhar_Number,
case when (b.UAN_Number is not null and b.UAN_Number !='') then b.UAN_Number else c.UAN end as 'UAN_Number',
case when (b.PAN_Number is not null and b.PAN_Number !='') then b.PAN_Number else a.PAN_No end as 'PAN_Number',
case when (c.Mediclaim_Login_id is not null and c.Mediclaim_Login_id !='') then c.Mediclaim_Login_id else B.Mediclaim_LoginId end as 'Mediclaim_LoginId',
case when (c.Mediclaim_Password is not null and c.Mediclaim_Password !='') then c.Mediclaim_Password else B.Mediclaim_Password end as 'Mediclaim_Password',
case when (c.ESIC_No is not null and c.ESIC_No !='') then ...
Go to the complete details ...