SELECT SQL_CALC_FOUND_ROWS p.* , (SELECT SUM(items_sold) FROM SC_products psort, SC_modifications_items misort WHERE psort.productID=misort.productID AND misort.Owner=p.productID) as items_sold, name_ru AS _name_sort, (SELECT MAX(in_stock) FROM SC_products p1, SC_modifications_items mi1 WHERE p1.productID=mi1.productID AND mi1.Owner=p.productID)>0 as `is_in_stock` FROM SC_products p WHERE enabled=1 AND p.categoryID<>1 AND p.categoryID<>775 AND productID IN (36779,43495,31740,51671,42379,31908,31934,46064,31947,31996,32081,32229,54765,47377,32260,32263,32268,43863,32383,32385,32387,43845,34408,29942,32449,39940,32498,40647,32524,32540,35721,32553,32561,32546,40383,32577,32706,36793,32766,40403,32867,32868,36534,32911,32970,33026,40388,33092,40174,33295,54699,49658,33740,33752,33758,33763,33767,33775,33800,33808,33827,33848,33849,45701,45716,45711,35273,33913,33926,33933,33945,33948,43303,33949,33951,33953,33954,33942,33993,34003,31518,44770,34105,34457,45493,34618,34671,34662,34631,44878,44887,34439,34446,34435,33588,34411,34111,51579,34100,33812,33815,39159,33880,33881,33790,33630,33632,33595,33604,33606,33610,48754,33527,45012,45018,33519,33520,33466,33473,45073,33366,33393,33259,35987,35995,33177,50326,50329,33075,33094,33124,33158,33167,33172,33002,32956,42989,32885,43142,32850,32870,32871,41689,32610,32611,42673,37062,45339,32644,32641,32741,32740,53405,54726,32775,32607,32173,32178,32179,32180,32181,32186,32187,32191,32237,32292,32316,32428,32147,43629,31689,31707,31711,31730,31766,36546,31807,31808,31939,31852,31896,36557,32042,32061,32088,32101,31563,31579,35791,50377,31473,31458,49040,49772,31295,31233,43111,43113,51544,31122,35976,31132,31048,31064,31071,30948,36579,49617,30747,51991,30705,42021,30713,42023,30725,30667,30670,30520,30421,30422,30424,30432,30296,30298,30407,30290,30273,30197,30166,30148,30103,30102,30111,30127,30020,29973,35928,29866,29813,29815,29834,29765,29766,51357,51674,29746,29737,29738,29656,29621,29589,31207,48869,29545,29535,29480,42060,42484,42485,42496,42419,29425,48600,43122,29230,48158,27979,35914,27982,29190,40179,48147,27925,39094,39102,42076,27910,27911,42077,42082,27889,27891,27902,27904,27861,41518,27844,41530,27740,27732,27686,27692,27697,36003,49927,34765,27677,36839,27638,27643,27644,27645,27647,53492,47481,27652,27620,27622,48512,27570,27578,27498,27502,27506,27507,27523,46770,43207,27444,27445,42994,42995,27405,27406,27407,27416,27393,35961,27351,27352,27353,49108,40952,40953,27226,27253,38843,47240,27259,40936,50727,27205,27208,34719,34720,34721,34726,34901,48919,43540,34908,34920,27054,34922,35952,26993,26995,26997,46021,46018,49207,26934,26963,41036,41039,34710,46906,34328,42349,26831,26828,26795,43378,26764,26781,26651,35933,26690,26692,31555,26694,26614,26616,26618,42344,26631,26632,34698,26537,45501,26489,26470,26387,26390,52719,27815,27813,31724,31732,31780,31797,31843,42627,31946,32012,32250,50155,32327,32392,43795,48418,32448,40198,49435,52567,32636,32642,49608,52571,32659,35684,35700,51321,32975,40416,45481,37407,33669,33718,51027,44725,33835,33903,33929,33931,33995,34032,34034,34094,50876,40365,34117,34121,50211,44081,34551,52357,34642,34590,34595,44890,40992,40430,34124,33986,41619,36792,33950,38828,45524,45745,33567,33532,33539,33509,33486,36538,40656,42630,35782,37065,33359,33365,33367,33371,33399,33283,45162,39933,33212,33176,50339,48260,49225,32940,32843,43195,32875,32788,36527,36529,32624,37329,32748,32733,38847,32776,32429,43620,32131,32133,32134,32136,36544,31731,31939,36501,53423,31941,54822,31869,31938,31952,50591,36562,42446,31643,40205,50678,31605,31262,31246,50168,31166,31164,31145,42089,31102,43757,39721,31013,42427,30979,43050,47317,30727,30603,30616,42459,30423,51393,30244,30273,30194,30095,36842,30107,30118,30028,29978,29985,29986,29852,29770,29798,29812,29849,29751,48183,48022,29692,29693,29620,29605,29543,29544,29550,51261,29551,29508,29450,54870,29380,29391,29287,40181,40182,45873,47522,40190,47525,27947,27881,34877,35901,41524,41550,27746,40358,40213,27698,46733,27654,27635,27538,42362,27535,27524,27508,27510,49486,27466,49119,49112,40942,47998,40956,47336,40978,27157,27168,44041,40999,41029,27041,52084,35941,26976,26980,26989,41037,26880,26884,46902,41006,43470,43388,26701,26706,26656,26548,49831,26452,26462,26466,26467,26472,40172,52489,32098,51332,51334,34026,34423,33507,33364,32716,36547,36555,31563,36622,29476,29477,27890,34855,27684,27688,41555,42363,27466,34752,26515,0) ORDER BY items_sold DESC LIMIT 40,40