SELECT s.id, s.extra, ss.ref_seminarka FROM seminarka AS s LEFT JOIN seminarka_spisovatel AS ss ON s.id = ss.ref_seminarka WHERE s.id IN(282, 353, 706, 742, 743, 763, 764, 771, 772, 1802, 1805, 1814, 2103, 2982, 2983, 2984, 2985, 2986, 3152, 3282, 3497, 3549, 3653, 3809, 3853, 4119, 4124, 4137, 4173, 4175, 4190, 4191, 4192, 4202, 4203, 4311, 4499, 4534, 4603, 4753, 4754, 4755, 4756, 4873, 5031, 5032, 5034, 5075, 5137, 5143, 5180, 5182, 5183, 5215, 5233, 5296, 5297, 5334, 5335, 5336, 5337, 5338, 5362, 5376, 5591, 5676, 5677, 5757, 6011, 6165, 6179, 6455, 6572, 6664, 6802, 6849, 6945, 7006, 7094, 7096, 7300, 7306, 7308, 7309, 7341, 7342, 7343, 7359, 7361, 7362, 7489, 7659, 7660, 7925, 8003, 8214, 8233, 8302, 8402, 8424, 8532, 8560, 8632, 8633, 8651, 8753, 8883, 8885, 8894, 8934, 9005, 9070, 9084, 9085, 9091, 9212, 9224, 9317, 9318, 9321, 9329, 9330, 9335, 9336, 9338, 9341, 9342, 9343, 9394, 9433, 9555, 9557, 9716, 9735, 9846, 9852, 10063, 10064, 10065, 10066, 10067, 10095, 10096, 10097, 10098, 10099, 10187, 10188, 10189, 10190, 10191, 10348, 10351, 10353, 10418, 10431, 10444, 10532, 10586, 10615, 10699, 10700, 10701, 10798, 10845, 10892, 10893, 10914, 11006, 11007, 11655, 11715, 11868, 11926, 11972, 12012, 12018, 12290, 12343, 12376, 12389, 12398, 12575, 12592, 12593, 12598, 12635, 12653, 12717, 12718, 12723, 12724, 12725, 12726, 12727, 12758, 12759, 12761, 12762, 12763, 12776, 12780, 12782, 12784, 12785, 12786, 12803, 12804, 12816, 12817, 12818, 12819, 12835, 12842, 12877, 12913, 12986, 13200, 13231, 13251, 13252, 13268, 13283, 13294, 13295, 13296, 13297, 13304, 13313, 13327, 13329, 13351, 13421, 13422, 13425, 13426, 13432, 13481, 13615, 13693, 13722, 13739, 13740, 13741, 13792, 13918, 13919, 13931, 13956, 14076, 14077, 14078, 14082, 14087, 14088, 14196, 14224, 14235, 14236, 14237, 14318, 14369, 14370, 14493, 14760, 14761, 14762, 15108, 15109, 15110, 15160, 15164, 15295, 15342, 15343, 15369, 15431, 15432, 15433, 15477, 15507, 15524, 15525, 15526, 15527, 15528, 15587, 15588, 15589, 15590, 15591, 15593, 15594, 15595, 15596, 15868, 15869, 15884, 15885, 15896, 15961, 15962, 15964, 16009, 16121, 16122, 16123, 16124, 16125, 16158, 16159, 16160, 16501, 16547, 16548, 16927, 17073, 17160, 17192, 17322, 17346, 17561, 17565, 17617, 17618, 17627, 17629, 17631, 17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17733, 17736, 17737, 17764, 17779, 17826, 17827, 17829, 17870, 17885, 17887, 17888, 18006, 18051, 18094, 18095, 18101, 18112, 18262, 18263, 18287, 18375, 18385, 18412, 18463, 18466, 18492, 18520, 18521, 18522, 18523, 18541, 18695, 18696, 18737, 18884, 19155, 19164, 19254, 19406, 19407, 19408, 19409, 19443, 19444, 19577, 19578, 19579, 19698, 19868, 20045, 20207, 20208, 20222, 20260, 20354, 20356, 20568, 20594, 20659, 20752, 20799, 20800, 20801, 20802, 20803, 20813, 20814, 20815, 20816, 20817, 20857, 20858, 20859, 20860, 20861, 20872, 20873, 20874, 20875, 20876, 20917, 20918, 20932, 20951, 21074, 21274, 21315, 21393, 21540, 21552, 21573, 21591, 21594, 21651, 21804, 22014, 22015, 22022, 22030, 22042, 22045, 22061, 22066, 22067, 22074, 22076, 22082, 22138, 22190, 22469, 22732, 22795, 22813, 23110, 23140, 23173, 23181, 23223, 23224, 23225, 23226, 23227, 23228, 23229, 23230, 23236, 23237, 23238, 23239, 23240, 23241, 23242, 23243, 23244, 23245, 23246, 23247, 23248, 23249, 23250, 23251, 23252, 23253, 23254, 23255, 23256, 23679, 23798, 24173, 24279, 24463, 24563, 24607, 24609, 24613, 24615, 24618, 24622, 24632, 24633, 24637, 24643, 24650, 24652, 24659, 24679, 24703, 24719, 24725, 24741, 24774, 24829, 24845, 24942, 24943, 24957, 24958, 24959, 24960, 24961, 24995, 24996, 25016, 25031, 25032, 25077, 25126, 25176, 25177, 25191, 25192, 25193, 25194, 25195, 25196, 25197, 25198, 25199, 25233, 25280, 25308, 25312, 25313, 25365, 25372, 25378, 25379, 25450, 25583, 25585, 25628, 25634, 25635, 25637, 25639, 25897, 25962, 25963, 25964, 25972, 25994, 26037, 26157, 26201, 26328, 26411, 26430, 26457, 26500, 26535, 26536, 26538, 26539, 26540, 26636, 26700, 26701, 26708, 26718, 26719, 26731, 26733, 26739, 26899, 26917, 26924, 26925, 26926, 26927, 26928, 26977, 26979, 26980, 26997, 27016, 27103, 27104, 27105, 27427, 27492, 27493, 27498, 27500, 27501, 27502, 27503, 27513, 27514, 27516, 27517, 27523, 27524, 27525, 27663, 27665, 27680, 27795, 27829, 27830, 27831, 27832, 27833, 27980, 27981, 27997, 28078, 28103, 28147, 28203, 28212, 28227, 28230, 28231, 28232, 28233, 28235, 28279, 28289, 28303, 28304, 28322, 28339, 28408, 28455, 28496, 28565, 28566, 28569, 28672, 28673, 28709, 28710, 28796, 28834, 28891, 29006, 29026, 29052, 29053, 29054, 29055, 29068, 29086, 29100, 29131, 29132, 29202, 29379, 29380, 29381, 29382, 29389, 29391, 29392, 29393, 29490, 29491, 29572, 29606, 29630, 29631, 29632, 29633, 29640, 29641, 29642, 29643, 29644, 29715, 29716, 29717, 29718, 29719, 29720, 29737, 29738, 29761, 29772, 29783, 29784, 29794, 29807, 29808, 29809, 29810, 29811, 29823, 29824, 29825, 29826, 29827, 29828, 29829, 29830, 29831, 29832, 29842, 29851, 29852, 29853, 29867, 29880, 29934, 29935, 29937, 29941, 29948, 29959, 29960, 29973, 29974, 29975, 30014, 30015, 30016, 30073, 30119, 30188, 30189, 30192, 30201, 30216, 30217, 30239, 30371, 30424, 30425, 30426, 30489, 30492, 30507, 30521, 30532, 30533, 30534, 30536, 30539, 30540, 30541, 30543, 30567, 30586, 30587, 30600, 30601, 30614, 30615, 30616, 30699, 30701, 30703, 30780, 30787, 30811, 30856, 30867, 30884, 30892, 30913, 30914, 30916, 30956, 30957, 30958, 30959, 30960, 30975, 30983, 31035, 31039, 31040, 31041, 31042, 31043, 31044, 31045, 31046, 31047, 31061, 31062, 31063, 31100, 31104, 31132, 31143, 31158, 31159, 31160, 31168, 31169, 31307, 31311, 31337, 31338, 31339, 31351, 31352, 31353, 31354, 31364, 31384, 31385, 31388, 31403, 31422, 31423, 31424, 31425, 31426, 31432, 31434, 31443, 31444, 31445, 31446, 31447, 31476, 31606, 31607, 31608, 31609, 31694, 31702, 31704, 31705, 31709, 31715, 31716, 31717, 31718, 31719, 31720, 31721, 31722, 31723, 31730, 31827, 31828, 31834, 31835, 31836, 31846, 31913, 32066, 32102, 32105, 32114, 32126, 32179, 32461, 32462, 32463, 32464, 32466, 32467, 32468, 32469, 32470, 32471, 32473, 32474, 32475, 32476, 32483, 32484, 32487, 32488, 32489, 32490, 32497, 32499, 32508, 32509, 32510, 32511, 32512, 32513, 32514, 32515, 32516, 32517, 32522, 32523, 32524, 32583, 32584, 32585, 32591, 32608, 32625, 32626, 32681, 32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692, 32830, 32884, 32885, 32886, 32887, 32888, 32889, 32890, 32891, 32892, 32893, 32895, 32896, 32897, 32898, 32899, 32901, 32902, 32903, 32904, 32905, 32906, 32931, 32978, 32982, 32983, 32990, 32991, 32992, 32993, 32994, 32997, 32998, 32999, 33000, 33001, 33007, 33008, 33009, 33010, 33011, 33012, 33013, 33014, 33040, 33110, 33113, 33117, 33119, 33147, 33208, 33323, 33324, 33349, 33361, 33362, 33392, 33482, 33483, 33515, 33516, 33517) and s.autorizace >0 and s.id in (select distinct STR_SEMINARKA_FK from strom where STR_SEMINARKA_TYP_FK in (2, 4, 20) or (STR_SEMINARKA_TYP_FK=17 and STR_SUBKATEGORIE_FK=247) or (STR_SEMINARKA_TYP_FK in (18, 1, 9, 11) and STR_SUBKATEGORIE_FK in (117, 342))) GROUP BY s.id