Land titles db: queries for orphaned owners
Posted by mholmes on 27 Oct 2014 in Activity log
Generated lists of owners who were previously connected to Block 43 and 52, so that they can be eliminated from the db if they're now no longer connected to anything else. SF is doing this work.
This is a query revealing candidates for deletion based on this:
SELECT * FROM owners WHERE own_owner_id IN ('127', '128', '164', '432', '436', '455', '456', '515', '533', '534', '535', '548', '549', '567', '585', '615', '616', '647', '648', '703', '718', '777', '785', '786', '788', '789', '790', '826', '872', '893', '950', '986', '1000', '1063', '1215', '1376', '1523', '1584', '1657', '1913', '2298', '2444', '2497', '2498', '2499', '2500', '2502', '2504', '2505', '2506', '2507', '2511', '2513', '2514', '2515', '2516', '2521', '2524', '2525', '2526', '2529', '2531', '2534', '2535', '2536', '2537', '2538', '2539', '2544', '2547', '2548', '2549', '2553', '2554', '2556', '2557', '2559', '2560', '2561', '2563', '2564', '2565', '2566', '2567', '2568', '2570', '2571', '2573', '2577', '2578', '2579', '2580', '2582', '2583', '2585', '2587', '2588', '2589', '2590', '2592', '2594', '2595', '2598', '2600', '2601', '2602', '2604', '2605', '2606', '2608', '2609', '2610', '2611', '2616', '2620', '2621', '2622', '2623', '2625', '2626', '2627', '2628', '2636', '2640', '2641', '2642', '2643', '2644', '2646', '2647', '2648', '2653', '2654', '2655', '2656', '2658', '2659', '2660', '2661', '2665', '2666', '2668', '2669', '2670', '2671', '2675', '2676', '2679', '2682', '2685', '2686', '2687', '2692', '2693', '2694', '2695', '2701', '2703', '2704', '2705', '2706', '2713', '2715', '2721', '2722', '2723', '2724', '2728', '2729', '2730', '2731', '2732', '2733', '2734', '2736', '2737', '2738', '2739', '2742', '2743', '2745', '2746', '2747', '2758', '2759', '2760', '2761', '2762', '2763', '2764', '2767', '2768', '2769', '2771', '2775', '2776', '2777', '2778', '2779', '2780', '2786', '2788', '2789', '2794', '2795', '2796', '2798', '2800', '2801', '2803', '2805', '2807', '2809', '2811', '2815', '2816', '2818', '2819', '2820', '2825', '2827', '2828', '2829', '2831', '2832', '2833', '2838', '2839', '2851', '2852', '2853', '2855', '2861', '2862', '2864', '2867', '2871', '2872', '2873', '2875', '2876', '2877', '2879', '2882', '2884', '2885', '2887', '2888', '2889', '2890', '2891', '2894', '2898', '2900', '2902', '2907', '2908', '2912', '2914', '2916', '2917', '2920', '2921', '2923', '2927', '2928', '2932', '2935', '2941', '2945', '2946', '2951', '2954', '2955', '2956', '2957', '2958', '2959', '2960', '2961', '2962', '2963', '2964', '2965', '2966', '2968', '2969', '2972', '2974', '2976', '2977', '2986', '2987', '2988', '2989', '2991', '2992', '2993', '2994', '2995', '2996', '2998', '3000', '3001', '3002', '3004', '3005', '3009', '3012', '3013', '3014', '3016', '3022', '3023', '3024', '3025', '3026', '3029', '3031', '3032', '3034', '3036', '3067', '3068', '3069', '3070', '3071', '3074', '3075', '3076', '3078', '3079', '3082', '3104', '3105', '3107', '3109', '3111', '3112', '3114', '3115', '3116', '3117', '3119', '3120', '3121', '3122', '3123', '3127', '3128', '3130', '3131', '3132', '3133', '3134', '3135', '3136', '3140', '3141', '3142', '3143', '3145', '3146', '3147', '3148', '3150', '3151', '3152') AND (SELECT COUNT(*) FROM owners_to_titles WHERE owners_to_titles.ott_owner_id_fk = owners.own_owner_id) = 0 AND (SELECT COUNT(*) FROM sellers_to_titles WHERE sellers_to_titles.stt_owner_id_fk = owners.own_owner_id) = 0
This currently reveals 352 out of the 368 listed in by id in the first clause.