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(24, 154, 155, 157, 158, 164, 168, 186, 230, 281, 549, 550, 564, 578, 608, 625, 651, 703, 711, 738, 748, 755, 759, 767, 773, 886, 900, 1047, 1141, 1142, 1143, 1144, 1146, 1149, 1150, 1728, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1888, 1986, 1987, 2158, 2159, 2317, 2424, 2425, 2486, 2529, 2555, 2556, 2574, 2638, 2639, 2665, 2705, 2710, 2713, 2802, 2896, 2921, 2928, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3029, 3030, 3031, 3032, 3033, 3034, 3115, 3124, 3131, 3216, 3218, 3221, 3230, 3247, 3260, 3262, 3266, 3276, 3277, 3310, 3314, 3330, 3337, 3356, 3373, 3402, 3424, 3430, 3498, 3563, 3564, 3595, 3610, 3620, 3621, 3627, 3629, 3631, 3632, 3660, 3765, 3768, 3841, 3844, 3851, 3868, 3939, 3986, 3993, 3995, 4142, 4263, 4367, 4388, 4405, 4421, 4623, 4744, 4771, 4781, 4919, 5113, 5118, 5138, 5139, 5208, 5224, 5235, 5413, 5500, 5563, 5583, 5627, 5758, 5800, 5807, 5834, 5886, 5922, 5990, 5997, 6055, 6163, 6195, 6206, 6489, 6538, 6646, 6723, 6724, 6810, 6904, 6996, 7033, 7140, 7144, 7198, 7288, 7290, 7307, 7346, 7354, 7379, 7414, 7476, 7485, 7506, 7522, 7523, 7658, 7670, 7778, 7806, 7836, 7853, 7973, 8116, 8117, 8159, 8161, 8163, 8192, 8210, 8238, 8246, 8279, 8335, 8343, 8443, 8473, 8481, 8546, 8608, 8621, 8732, 8778, 8942, 8960, 9240, 9472, 9473, 9510, 9570, 9635, 9724, 9814, 9837, 9851, 9946, 9954, 9974, 9981, 9996, 10000, 10002, 10026, 10027, 10051, 10087, 10352, 10376, 10384, 10404, 10440, 10479, 10688, 10709, 10801, 10803, 10830, 10940, 11001, 11049, 11100, 11145, 11194, 11224, 11240, 11253, 11280, 11283, 11340, 11418, 11441, 11487, 11528, 11538, 11546, 11581, 11588, 11591, 11610, 11642, 11749, 11750, 11759, 11774, 11789, 11827, 11865, 11893, 11897, 11907, 11963, 11968, 11977, 12042, 12045, 12073, 12076, 12204, 12205, 12206, 12217, 12239, 12251, 12287, 12328, 12381, 12462, 12482, 12484, 12599, 12645, 12683, 12812, 12834, 12947, 13092, 13115, 13122, 13154, 13156, 13158, 13230, 13241, 13264, 13359, 13440, 13463, 13819, 13829, 13841, 13953, 13966, 13968, 14052, 14053, 14054, 14058, 14073, 14081, 14219, 14257, 14292, 14325, 14400, 14414, 14507, 14541, 14544, 14559, 14578, 14602, 14695, 14715, 14765, 14776, 14811, 14979, 15032, 15072, 15085, 15086, 15127, 15137, 15197, 15200, 15202, 15204, 15314, 15315, 15429, 15551, 15572, 15598, 15599, 15656, 15681, 15722, 15727, 15729, 15736, 15778, 15780, 15814, 15827, 15829, 15915, 15926, 15928, 15929, 15942, 16064, 16075, 16083, 16098, 16105, 16368, 16405, 16485, 16487, 16525, 16541, 16559, 16586, 16603, 16615, 16715, 16716, 16832, 16846, 16941, 16957, 16986, 17074, 17106, 17112, 17132, 17182, 17213, 17287, 17304, 17305, 17350, 17352, 17353, 17355, 17387, 17402, 17409, 17416, 17422, 17496, 17503, 17508, 17510, 17545, 17546, 17547, 17548, 17580, 17591, 17633, 17640, 17641, 17642, 17643, 17644, 17645, 17646, 17647, 17648, 17649, 17660, 17711, 17743, 18010, 18031, 18081, 18086, 18093, 18096, 18099, 18135, 18143, 18146, 18171, 18185, 18214, 18253, 18305, 18306, 18326, 18327, 18330, 18347, 18360, 18361, 18444, 18455, 18474, 18496, 18512, 18529, 18612, 18637, 18682, 18753, 18786, 18809, 18810, 18812, 18846, 18860, 18893, 18908, 18927, 18928, 19024, 19028, 19061, 19199, 19331, 19335, 19346, 19347, 19393, 19427, 19454, 19487, 19488, 19497, 19500, 19501, 19510, 19592, 19593, 19594, 19595, 19638, 19665, 19795, 19803, 19815, 19876, 19986, 20039, 20103, 20160, 20215, 20247, 20281, 20294, 20321, 20326, 20329, 20330, 20349, 20370, 20395, 20413, 20425, 20477, 20543, 20557, 20564, 20583, 20586, 20674, 20676, 20682, 20691, 20755, 20845, 20882, 20885, 20936, 20977, 20979, 20981, 21026, 21029, 21036, 21079, 21134, 21189, 21192, 21217, 21275, 21276, 21277, 21280, 21281, 21305, 21306, 21307, 21308, 21309, 21333, 21356, 21357, 21358, 21459, 21465, 21467, 21468, 21469, 21471, 21477, 21485, 21522, 21526, 21585, 21592, 21600, 21610, 21611, 21670, 21717, 21775, 21796, 21797, 21798, 21799, 21915, 21951, 22098, 22163, 22238, 22388, 22390, 22404, 22418, 22419, 22434, 22470, 22525, 22542, 22547, 22553, 22562, 22744, 22888, 22891, 22897, 22932, 22964, 22974, 22988, 23020, 23021, 23022, 23023, 23033, 23059, 23119, 23159, 23198, 23199, 23200, 23201, 23202, 23410, 23425, 23426, 23454, 23455, 23471, 23478, 23820, 23947, 23952, 23955, 24124, 24125, 24157, 24402, 24405, 24564, 24588, 24608, 24705, 24712, 24728, 24738, 24791, 24843, 24926, 24947, 24972, 24973, 24974, 24975, 24976, 24977, 24978, 24979, 24986, 24987, 24988, 24993, 24994, 24997, 25023, 25025, 25027, 25053, 25134, 25300, 25420, 25429, 25441, 25577, 25597, 25643, 25855, 25905, 25913, 25915, 25932, 25940, 25941, 25944, 25952, 26080, 26226, 26228, 26229, 26254, 26258, 26261, 26279, 26280, 26357, 26417, 26533, 26585, 26596, 26597, 26598, 26599, 26686, 27194, 27198, 27313, 27519, 27533, 27811, 27912, 27914, 27998, 28001, 28002, 28093, 28243, 28244, 28245, 28543, 28624, 28878, 29024, 29135, 29136, 29330, 29360, 29412, 29603, 29727, 29728, 29798, 29802, 29814, 30033, 30466, 31323, 31363, 31519, 31764, 31765, 31768, 31769, 31771, 31773, 31774, 31777, 31778, 31780, 31782, 31784, 31796, 31797, 31798, 31801, 31802, 31806, 32206, 32478, 32479, 33251, 33419) 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