select 0 as discountqstart1,[index].sizedesc ,0 as discountqstart2,0 as discountqstart3,0 as discountqstart4, 0 as discountqstart5, 0 as discount1, 0 as discount2, 0 as discount3,0 as discount4,0 as discount5, CASE WHEN (len([index].sizedesc) > 0) AND ([index].sizedesc <> 'nonee') AND ([index].sizedesc <> '0') THEN 2 ELSE 0 END AS tipos, [index].realcode prodcode, [index].price AS price, 0 as catprice,products.ordervalue plogo,products.menudesc as lmenudesc,products.desc1 as ldesc1, products.desc2 as ldesc2,products.siskeuasia, products.mmetrisis, 0 AS specialprice , [index].activity, [index].quantity as quantity, [index].checkcode, [index].myaa, 0 AS retailprice, products.foto1, products.foto2, products.foto3, products.foto4, products.foto5, CASE WHEN (products.producttype = 11 AND [index].quantity > 0) THEN 1 WHEN (products.producttype = 12) THEN 2 WHEN (products.producttype = 13) THEN 3 WHEN (products.producttype = 11 AND [index].quantity < 1) THEN 0 else 0 END AS buystatus, products.discount, CASE WHEN products.discount > 0 THEN 1 ELSE 0 END AS ratio, products.monada, products.pricesid, products.vatcode, products.supplier, products.minimumstep, products.minquantity,products.prodescription as prodescription,case when products.menudesc is null then 'uncategorized' else products.menudesc end as menudesc,case when products.desc1 is null then 'uncategorized' else products.desc1 end as desc1,products.desc1 qdesc1,products.desc2 qdesc2,case when products.desc2 is null then 'uncategorized' else products.desc2 end as desc2, products.txts as txts FROM [index] LEFT OUTER JOIN products ON [index].checkcode = products.checkcode WHERE ([index].prodcode = '01-01-05-08-006' or [index].checkcode = '01-01-05-08-006') AND (products.activity = 1) order by [index].sizedesc