select t.id, t.sorter, n.name, n.nodeTypeId, na.tagNames from tagT t join nodeT n on t.id = n.id left join nodeAncestryT na on n.id = na.id and na.languageId = 'ukr' where 1 = 1 and n.nodeTypeId = 7 and n.id in ( 66806, 68347, 69451, 70993, 72335, 74028, 74651, 75632, 24, 77660, 78719, 79669, 81624, 82569, 83779, 85659, 86703, 9, 89299, 91094, 91814, 93286, 94165, 94597, 65768, 6830, 7868, 9409, 10513, 12055, 13397, 15090, 15713, 16694, 24, 18722, 19781, 6801, 22686, 23631, 24841, 26721, 27765, 9, 2431, 32156, 32876, 34348, 35227, 35659 ); update tagT t join nodeT n on t.id = n.id set t.sorter = 1 where 1 = 1 and n.nodeTypeId = 7 and n.id in ( 66806, 68347, 69451, 70993, 72335, 74028, 74651, 75632, 24, 77660, 78719, 79669, 81624, 82569, 83779, 85659, 86703, 9, 89299, 91094, 91814, 93286, 94165, 94597, 65768, 6830, 7868, 9409, 10513, 12055, 13397, 15090, 15713, 16694, 24, 18722, 19781, 6801, 22686, 23631, 24841, 26721, 27765, 9, 2431, 32156, 32876, 34348, 35227, 35659 );