CREATE TEMPORARY TABLE temporaryGoodsTable SELECT product.id, product.image, product.imageDirectory, product.imageInteriorCheck, product.collection, product.collectionName, product.collectionParentName, product.madeComp, product.madeCompName, product.newGroup, product.newGroup2, product.price, product.price_m, product.discountPercent, product.discountInfo, product.unit, product.unit_amount, product.oldPrice, product.cartPrice, product.newPrice, product.getPrice, product.availabilityShop, product.availabilitySpb, product.availabilityMsk, product.availabilityEurope, product.availabilityOther, product.view, product.obsolete FROM product WHERE 1 and ( newGroup = 373 OR newGroup2 = 373 ) AND product.view=1 AND product.obsolete=0 AND (product.availabilitySpb>0 OR product.availabilityMsk>0 OR product.availabilityShop>0 OR product.availabilityOther!="") CREATE TEMPORARY TABLE temporaryGoodsTable_FST SELECT temporaryGoodsTable.* FROM temporaryGoodsTable JOIN product_main ON (temporaryGoodsTable.id=product_main.pid and product_main.height_min_mm<=1320 and product_main.height_min_mm!=0 and product_main.color_arm LIKE "%Серебро%") WHERE 1;