Hi,I'm writing a Query to create a file with data of some record. I get this data from different rows.I need to include some code that verify in that record exist in other table named SUBSCRIBERCOB and if it exist write in the file TRUE or FALSE, in the same row with all the other data of the record.Please help me, I don't know if I can use CASE and If exist.SELECT CASE WHEN S.subscriber_dep_num_str_id = '00' THEN '0' WHEN S.subscriber_dep_num_str_id BETWEEN '20' AND '49' THEN '1' Else '2' END,S.social_security_num_str,dbo.fn_MA_Pad_String(CL.first_name_str,25),dbo.fn_MA_Pad_String(CL.second_name_str,1),dbo.fn_MA_Pad_String(CL.first_last_name_str,25),dbo.fn_MA_Pad_String(ltrim(rtrim(CA.address1_str)) + ' ' + ltrim(CA.address2_str),60),dbo.fn_MA_Pad_String(CA.city_str,15),dbo.fn_MA_Pad_String(CA.state_str_id,4),dbo.fn_MA_Pad_String(CA.zip_code1_str_id,6),dbo.fn_MA_Pad_String(S.policy_type_num_id,2),dbo.fn_MA_Pad_String(CT.contract_type_str_id,3),convert(varchar(10), S.premium_effective_date, 111),convert(varchar(10), S.birth_date, 111),CASE WHEN S.coverages_str like '%C%'THEN '1' Else '0' END AS MedicareFROM Subscriber SINNER JOIN Client CL ONS.subscriber_identity_num_id = CL.subscriber_identity_num_idINNER JOIN DependentCode DC ONDC.subscriber_dep_num_str_id = S.dep_rel_code_str_idINNER JOIN Contract C ONC.contract_client_num_str_id = S.contract_client_num_str_idINNER JOIN ContractType CT ONC.contract_type_str_id = CT.contract_type_str_idINNER JOIN SubscriberAddress SA ONS.subscriber_identity_num_id = SA.subscriber_identity_num_idINNER JOIN ClientAddress CA ONCA.sequence_num = SA.sequence_numWHERE S.group_code_str = '115090' AND S.status_code_str_id = '1' AND CA.address_location_num_id = '1'