Skip to content

Instantly share code, notes, and snippets.

@dkobia
Created October 19, 2010 23:47
Show Gist options
  • Save dkobia/635437 to your computer and use it in GitHub Desktop.
Save dkobia/635437 to your computer and use it in GitHub Desktop.
SELECT COUNT(id) as count FROM incident WHERE incident_active=1 AND id IN (7,16,45,48,75,149,161,249,290,458,563,631,681,739,751,805,840,880,903,906,916,987,994,1045,1048,1054,1065,1074,1083,1102,1108,1199,1238,1282,1298,1337,1380,1421,1478,1573,1579,1586,1603,1618,1621,1633,1646,1738,1761,1781,1805,1819,1830,1876,1902,1932,1963,1975,1999,2017,2045,2050,2051,2062,2075,2081,2117,2120,2125,2130,2137,2153,2172,2181,2191,2202,2207,2208,2220,2232,2259,2277,2296,2302,2319,2326,2333,2334,2336,2344,2345,2346,2350,2362,2374,2389,2394,2404,2409,2413,2414,2427,2437,2445,2447,2448,2453,2467,2470,2471,2473,2482,2488,2489,2492,2514,2534,2539,2540,2543,2549,2561,2564,2565,2571,2574,2575,2579,2580,2585,2586,2616,2617,2628,2647,2655,2659,2676,2690,2697,2699,2704,2707,2708,2709,2711,2718,2723,2731,2745,2755,2763,2764,2768,2772,2775,2779,2780,2785,2787,2797,2802,2806,2811,2812,2819,2821,2826,2830,2834,2840,2843,2853,2855,2858,2863,2867,2878,2885,2886,2897,2901,2904,2908,2911,2925,2931,2972,2982,2997,3008,3013,3019,3030,3034,3057,3068,3070,3074,3075,3122,3171,3176,3226,3252)
SELECT id, incident_title, incident_description, incident_date, location_id, incident_verified FROM incident WHERE 1=1 AND id IN (7,16,45,48,75,149,161,249,290,458,563,631,681,739,751,805,840,880,903,906,916,987,994,1045,1048,1054,1065,1074,1083,1102,1108,1199,1238,1282,1298,1337,1380,1421,1478,1573,1579,1586,1603,1618,1621,1633,1646,1738,1761,1781,1805,1819,1830,1876,1902,1932,1963,1975,1999,2017,2045,2050,2051,2062,2075,2081,2117,2120,2125,2130,2137,2153,2172,2181,2191,2202,2207,2208,2220,2232,2259,2277,2296,2302,2319,2326,2333,2334,2336,2344,2345,2346,2350,2362,2374,2389,2394,2404,2409,2413,2414,2427,2437,2445,2447,2448,2453,2467,2470,2471,2473,2482,2488,2489,2492,2514,2534,2539,2540,2543,2549,2561,2564,2565,2571,2574,2575,2579,2580,2585,2586,2616,2617,2628,2647,2655,2659,2676,2690,2697,2699,2704,2707,2708,2709,2711,2718,2723,2731,2745,2755,2763,2764,2768,2772,2775,2779,2780,2785,2787,2797,2802,2806,2811,2812,2819,2821,2826,2830,2834,2840,2843,2853,2855,2858,2863,2867,2878,2885,2886,2897,2901,2904,2908,2911,2925,2931,2972,2982,2997,3008,3013,3019,3030,3034,3057,3068,3070,3074,3075,3122,3171,3176,3226,3252) AND incident_active = 1 ORDER BY incident_date DESC LIMIT 20 OFFSET 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment