create or replace view orwell_bridge.v_in_meetings_merkatus as SELECT *
                                                                  FROM merkatus_sync_meeting.meetings_merkatus ;


create or replace view orwell_bridge.v_in_meetings_zoho_import as SELECT *
                                                                  FROM leadbridge_zoho_update_prospect.prospect ;
A = orwell_bridge.v_in_meetings_zoho_import.siret
B =   orwell_bridge.v_in_meetings_merkatus.siret



create or replace view orwell_bridge.v_import_successful as SELECT siret
FROM orwell_bridge.v_in_meetings_zoho_import
         RIGHT JOIN orwell_bridge.v_in_meetings_merkatus ON
             orwell_bridge.v_in_meetings_zoho_import.siret = orwell_bridge.v_in_meetings_merkatus.siret;





create or replace view orwell_bridge.v_import_merkatus as
SELECT siret
FROM orwell_bridge.v_in_meetings_merkatus WHERE  orwell_bridge.v_in_meetings_merkatus.import_to_zoho_date_time >  '2024/03/26 00:00:00'






create or replace view orwell_bridge.v_out_meeting_not_imported as
SELECT orwell_bridge.v_in_meetings_merkatus.siret
FROM orwell_bridge.v_in_meetings_merkatus WHERE  orwell_bridge.v_in_meetings_merkatus.import_to_zoho_date_time >  '2024/03/26 00:00:00' AND orwell_bridge.v_in_meetings_merkatus.siret NOT IN(
    SELECT orwell_bridge.v_in_meetings_zoho_import.siret
    FROM orwell_bridge.v_in_meetings_zoho_import

);

